From 03c7986bb026cda8dbb8c8ef6cff3d70a50adf87 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 8 Dec 2021 10:31:56 -0700 Subject: [PATCH] ci: bleh, do retry inline as part of upload --- .github/workflows/gen_centos8_continuous.yml | 20 ++++++++++++++++++- .../workflows/gen_debian10.3_continuous.yml | 20 ++++++++++++++++++- .github/workflows/gen_debian11_continuous.yml | 20 ++++++++++++++++++- .../workflows/gen_debian9.12_continuous.yml | 20 ++++++++++++++++++- .github/workflows/gen_fedora33_continuous.yml | 20 ++++++++++++++++++- .github/workflows/gen_fedora34_continuous.yml | 20 ++++++++++++++++++- .github/workflows/gen_fedora35_continuous.yml | 20 ++++++++++++++++++- .github/workflows/gen_macos_continuous.yml | 20 ++++++++++++++++++- .github/workflows/gen_ubuntu18_continuous.yml | 20 ++++++++++++++++++- .../workflows/gen_ubuntu20.04_continuous.yml | 20 ++++++++++++++++++- .github/workflows/gen_windows_continuous.yml | 20 ++++++++++++++++++- ci/generate-workflows.py | 20 ++++++++++++++++++- 12 files changed, 228 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gen_centos8_continuous.yml b/.github/workflows/gen_centos8_continuous.yml index bfffeeb98..7b5fd8086 100644 --- a/.github/workflows/gen_centos8_continuous.yml +++ b/.github/workflows/gen_centos8_continuous.yml @@ -136,4 +136,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly wezterm-*.rpm + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/.github/workflows/gen_debian10.3_continuous.yml b/.github/workflows/gen_debian10.3_continuous.yml index 89e22a6f9..f995e8736 100644 --- a/.github/workflows/gen_debian10.3_continuous.yml +++ b/.github/workflows/gen_debian10.3_continuous.yml @@ -158,4 +158,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/.github/workflows/gen_debian11_continuous.yml b/.github/workflows/gen_debian11_continuous.yml index 05156591c..4a72fcfa7 100644 --- a/.github/workflows/gen_debian11_continuous.yml +++ b/.github/workflows/gen_debian11_continuous.yml @@ -158,4 +158,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/.github/workflows/gen_debian9.12_continuous.yml b/.github/workflows/gen_debian9.12_continuous.yml index 6aa4b33af..4265c7669 100644 --- a/.github/workflows/gen_debian9.12_continuous.yml +++ b/.github/workflows/gen_debian9.12_continuous.yml @@ -171,4 +171,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/.github/workflows/gen_fedora33_continuous.yml b/.github/workflows/gen_fedora33_continuous.yml index 5282cb596..1ec369e30 100644 --- a/.github/workflows/gen_fedora33_continuous.yml +++ b/.github/workflows/gen_fedora33_continuous.yml @@ -131,4 +131,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly wezterm-*.rpm + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/.github/workflows/gen_fedora34_continuous.yml b/.github/workflows/gen_fedora34_continuous.yml index 410aa8229..9bf21c1c0 100644 --- a/.github/workflows/gen_fedora34_continuous.yml +++ b/.github/workflows/gen_fedora34_continuous.yml @@ -131,4 +131,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly wezterm-*.rpm + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/.github/workflows/gen_fedora35_continuous.yml b/.github/workflows/gen_fedora35_continuous.yml index 95f711ba2..a08a66847 100644 --- a/.github/workflows/gen_fedora35_continuous.yml +++ b/.github/workflows/gen_fedora35_continuous.yml @@ -131,4 +131,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly wezterm-*.rpm + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/.github/workflows/gen_macos_continuous.yml b/.github/workflows/gen_macos_continuous.yml index e4f2f2a31..71937d13d 100644 --- a/.github/workflows/gen_macos_continuous.yml +++ b/.github/workflows/gen_macos_continuous.yml @@ -115,4 +115,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly WezTerm-*.zip" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly WezTerm-*.zip + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/.github/workflows/gen_ubuntu18_continuous.yml b/.github/workflows/gen_ubuntu18_continuous.yml index 9a8ad569d..1ef441634 100644 --- a/.github/workflows/gen_ubuntu18_continuous.yml +++ b/.github/workflows/gen_ubuntu18_continuous.yml @@ -116,4 +116,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz *src.tar.gz *.AppImage *.zsync" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz *src.tar.gz *.AppImage *.zsync + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/.github/workflows/gen_ubuntu20.04_continuous.yml b/.github/workflows/gen_ubuntu20.04_continuous.yml index a9126b555..3cb79c94b 100644 --- a/.github/workflows/gen_ubuntu20.04_continuous.yml +++ b/.github/workflows/gen_ubuntu20.04_continuous.yml @@ -158,4 +158,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/.github/workflows/gen_windows_continuous.yml b/.github/workflows/gen_windows_continuous.yml index 8c6a9595f..c33bb4c1a 100644 --- a/.github/workflows/gen_windows_continuous.yml +++ b/.github/workflows/gen_windows_continuous.yml @@ -90,4 +90,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - run: "bash ci/retry.sh gh release upload --clobber nightly WezTerm-*.zip WezTerm-*.exe" + run: | + + set -x + set -e + + max_attempts=4 + attempt=1 + + until gh release upload --clobber nightly WezTerm-*.zip WezTerm-*.exe + do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) + done diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index 13c38da6b..61a3ece1b 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -422,7 +422,25 @@ cargo build --all --release""", ), RunStep( "Upload to Nightly Release", - f"bash ci/retry.sh gh release upload --clobber nightly {glob}", + f""" +set -x +set -e + +max_attempts=4 +attempt=1 + +until gh release upload --clobber nightly {glob} +do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) +done +""", env={"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"}, ), ]