From 71475db952390de295c58ae6556f3cb0efcc0497 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 5 Feb 2024 15:01:56 +0100 Subject: [PATCH] WORKFLOWS: updated from cooker-0.8.0b --- .../cooker-selfhosted-persistent.yml | 8 +-- .github/workflows/cooker-selfhosted.yml | 61 ++++++++++--------- .github/workflows/main-selfhosted.yml | 6 +- .github/workflows/removed/cooker.yml | 6 +- .github/workflows/removed/main.yml | 6 +- .github/workflows/runner-cleanup.yml | 12 ---- .github/workflows/submodule-update.yml | 4 +- 7 files changed, 45 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/runner-cleanup.yml diff --git a/.github/workflows/cooker-selfhosted-persistent.yml b/.github/workflows/cooker-selfhosted-persistent.yml index bf45a7b1..dced323f 100644 --- a/.github/workflows/cooker-selfhosted-persistent.yml +++ b/.github/workflows/cooker-selfhosted-persistent.yml @@ -64,7 +64,7 @@ jobs: - name: "Build flatpak: download only" id: "flatpak-download" - run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_download_only.sh" + run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_download_only_persistent.sh" continue-on-error: true # Sometimes flatpak download fails, in this case it tries a second time @@ -76,10 +76,10 @@ jobs: rm -f "{GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml" cp "${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml.bak" "${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml" "${GITHUB_WORKSPACE}/automation_tools/pre_build_automation.sh" - "${GITHUB_WORKSPACE}/automation_tools/flatpak_build_download_only.sh" + "${GITHUB_WORKSPACE}/automation_tools/flatpak_build_download_only_persistent.sh" - name: Build flatpak - run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_only.sh" + run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_only_persistent.sh" - name: Create Artifact for flathub run: | @@ -90,7 +90,7 @@ jobs: continue-on-error: true - name: Create Bundle - run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_bundle.sh" + run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_bundle_persistent.sh" - name: Set environment variable with current branch name run: echo "GITHUB_REF_SLUG=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index b2dcd994..43d086c9 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -1,23 +1,28 @@ name: "Build cooker" on: - push: - branches: - - cooker* - - feat* - paths: - - '.github/workflows/**' - - 'automation_tools/**' - - 'emu-configs/**' - - 'es-configs/**' - - 'functions/**' - - 'rd-submodules/**' - - '*.sh' - - 'net.retrodeck.retrodeck.yml' - - 'net.retrodeck.retrodeck.appdata.xml' - pull_request: - branches: - - cooker* + # push: + # branches: + # - cooker* + # - feat* + # paths: + # - '.github/workflows/**' + # - 'automation_tools/**' + # - 'emu-configs/**' + # - 'es-configs/**' + # - 'functions/**' + # - 'rd-submodules/**' + # - '*.sh' + # - 'net.retrodeck.retrodeck.yml' + # - 'net.retrodeck.retrodeck.appdata.xml' + # pull_request: + # branches: + # - cooker* + + # Italy (CET): 11:00 PM + # Japan (JST): 7:00 AM + schedule: + - cron: '0 22 * * *' workflow_dispatch: @@ -42,15 +47,11 @@ jobs: run: "automation_tools/install_dependencies.sh" - name: Generate cooker build ID - run: | - word1=$(shuf -n 1 ${GITHUB_WORKSPACE}/automation_tools/codename_wordlist.txt) - capitalized_word1="$(tr '[:lower:]' '[:upper:]' <<< ${word1:0:1})${word1:1}" - word2=$(shuf -n 1 ${GITHUB_WORKSPACE}/automation_tools/codename_wordlist.txt) - capitalized_word2="$(tr '[:lower:]' '[:upper:]' <<< ${word2:0:1})${word2:1}" - result=$capitalized_word1$capitalized_word2 - echo $result > ${GITHUB_WORKSPACE}/buildid - echo "buildid=$result" >> $GITHUB_ENV - echo "VersionID is $result" + run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_build_id.sh" + + # backing up manifest in case download fails and hashes must be recalculated + - name: Manifest backup + run: "cp ${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml ${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml.bak" - name: Run pre-build automation tasks run : "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/pre_build_automation.sh" @@ -74,10 +75,11 @@ jobs: if: steps.flatpak-download.outcome == 'failure' run: | echo "Download failed, maybe some hash changed since the build start." - git checkout -- net.retrodeck.retrodeck.yml echo "Recalculating hashes and retrying download..." - "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/pre_build_automation.sh" - "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_download_only.sh" + rm -f "{GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml" + cp "${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml.bak" "${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml" + "${GITHUB_WORKSPACE}/automation_tools/pre_build_automation.sh" + "${GITHUB_WORKSPACE}/automation_tools/flatpak_build_download_only.sh" - name: Build flatpak run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_only.sh" @@ -151,3 +153,4 @@ jobs: name: retrodeck-flatpak path: RetroDECK-cooker.flatpak continue-on-error: true + diff --git a/.github/workflows/main-selfhosted.yml b/.github/workflows/main-selfhosted.yml index d768c5a3..2618d7ba 100644 --- a/.github/workflows/main-selfhosted.yml +++ b/.github/workflows/main-selfhosted.yml @@ -58,10 +58,6 @@ jobs: id: check_version_string run: "automation_tools/main_version_checker.sh" - - name: Validate Manifest (main only) - id: validate_manifest - run: "automation_tools/manifest_validation.sh" - - name: "[DEBUG] Outputting manifest" run: cat net.retrodeck.retrodeck.yml @@ -125,4 +121,4 @@ jobs: with: name: retrodeck-flatpak path: RetroDECK.flatpak - continue-on-error: true \ No newline at end of file + continue-on-error: true diff --git a/.github/workflows/removed/cooker.yml b/.github/workflows/removed/cooker.yml index ff8330e3..3fe7c469 100644 --- a/.github/workflows/removed/cooker.yml +++ b/.github/workflows/removed/cooker.yml @@ -68,7 +68,7 @@ jobs: - name: Buld part 1 - Until melonds run: | - sudo flatpak-builder --build-only --stop-at=melonds --user --force-clean --repo=${GITHUB_WORKSPACE}/local retrodeck-flatpak-cooker net.retrodeck.retrodeck.yml + sudo flatpak-builder --build-only --stop-at=melonds --user --force-clean --repo=${GITHUB_WORKSPACE}/.local retrodeck-flatpak-cooker net.retrodeck.retrodeck.yml - name: Compress cache run: | @@ -140,8 +140,8 @@ jobs: - name: Create Bundle run: | - sudo flatpak-builder --user --force-clean --repo=${GITHUB_WORKSPACE}/local retrodeck-flatpak-cooker net.retrodeck.retrodeck.yml - sudo flatpak build-bundle $GITHUB_WORKSPACE/local RetroDECK.flatpak net.retrodeck.retrodeck + sudo flatpak-builder --user --force-clean --repo=${GITHUB_WORKSPACE}/.local retrodeck-flatpak-cooker net.retrodeck.retrodeck.yml + sudo flatpak build-bundle $GITHUB_WORKSPACE/.local RetroDECK.flatpak net.retrodeck.retrodeck - name: Get date for artifacts id: date diff --git a/.github/workflows/removed/main.yml b/.github/workflows/removed/main.yml index 0404e018..25396232 100644 --- a/.github/workflows/removed/main.yml +++ b/.github/workflows/removed/main.yml @@ -69,7 +69,7 @@ jobs: - name: Buld part 1 - Until melonds run: | - sudo flatpak-builder --build-only --stop-at=melonds --user --force-clean --repo=${GITHUB_WORKSPACE}/local retrodeck-flatpak-main net.retrodeck.retrodeck.yml + sudo flatpak-builder --build-only --stop-at=melonds --user --force-clean --repo=${GITHUB_WORKSPACE}/.local retrodeck-flatpak-main net.retrodeck.retrodeck.yml - name: Compress cache run: | @@ -141,8 +141,8 @@ jobs: - name: Create Bundle run: | - sudo flatpak-builder --user --force-clean --repo=${GITHUB_WORKSPACE}/local retrodeck-flatpak-main net.retrodeck.retrodeck.yml - sudo flatpak build-bundle $GITHUB_WORKSPACE/local RetroDECK.flatpak net.retrodeck.retrodeck + sudo flatpak-builder --user --force-clean --repo=${GITHUB_WORKSPACE}/.local retrodeck-flatpak-main net.retrodeck.retrodeck.yml + sudo flatpak build-bundle $GITHUB_WORKSPACE/.local RetroDECK.flatpak net.retrodeck.retrodeck - name: Read version from version file id: version diff --git a/.github/workflows/runner-cleanup.yml b/.github/workflows/runner-cleanup.yml deleted file mode 100644 index dbccdad3..00000000 --- a/.github/workflows/runner-cleanup.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: "Runner Cleanup" - -on: - workflow_dispatch: - -jobs: - Cleanup: - runs-on: self-hosted - steps: - - name: Self Hosted Runner Post Job Cleanup Action - uses: TooMuch4U/actions-clean@v2.1 - \ No newline at end of file diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index d38f9f83..03ab876b 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -2,8 +2,8 @@ name: Sunday Submodule Update on: # At 4:00 (CET) - #schedule: - # - cron: '0 2 * * 0' + # schedule: + # - cron: '0 2 * * 0' workflow_dispatch: jobs: