WORKFLOW: recalculating hashes if download failed the first time

This commit is contained in:
XargonWan 2023-12-16 18:25:01 +01:00
parent f9f7d3ce20
commit ecdfbc24cf
2 changed files with 12 additions and 5 deletions

View file

@ -70,12 +70,14 @@ jobs:
continue-on-error: true continue-on-error: true
# Sometimes flatpak download fails, in this case it tries a second time # 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)" - name: "Build flatpak: download only (retry)"
if: steps.flatpak-download.outcome == 'failure' 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 - name: Build flatpak
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_only.sh" run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_only.sh"

View file

@ -69,7 +69,12 @@ jobs:
# Sometimes flatpak download fails, in this case it tries a second time # Sometimes flatpak download fails, in this case it tries a second time
- name: "Build flatpak: download only (retry)" - name: "Build flatpak: download only (retry)"
if: steps.flatpak-download.outcome == 'failure' 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 - name: Build flatpak
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_only.sh" run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_only.sh"