From 927e2737774a1558a9ed60885193756f5adc7b04 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Sat, 16 Dec 2023 18:25:01 +0100 Subject: [PATCH] WORKFLOW: recalculating hashes if download failed the first time --- .github/workflows/cooker-selfhosted.yml | 10 ++++++---- .github/workflows/main-selfhosted.yml | 7 ++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 957d036a..a466e68d 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -62,12 +62,14 @@ jobs: continue-on-error: true # Sometimes flatpak download fails, in this case it tries a second time - - name: Run pre-build automation tasks (retry) - if: steps.flatpak-download.outcome == 'failure' - run : "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/pre_build_automation.sh" - name: "Build flatpak: download only (retry)" if: steps.flatpak-download.outcome == 'failure' - run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_download_only.sh" + 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" - name: Build flatpak run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_only.sh" diff --git a/.github/workflows/main-selfhosted.yml b/.github/workflows/main-selfhosted.yml index 4e533c2d..c0523f47 100644 --- a/.github/workflows/main-selfhosted.yml +++ b/.github/workflows/main-selfhosted.yml @@ -65,7 +65,12 @@ jobs: # Sometimes flatpak download fails, in this case it tries a second time - name: "Build flatpak: download only (retry)" if: steps.flatpak-download.outcome == 'failure' - run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_download_only.sh" + 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" - name: Build flatpak run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_only.sh"