From 1e8ebdadfd2ae1f77b363d1294c7ac45f9927e9d Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 6 Dec 2021 09:11:26 -0700 Subject: [PATCH] ci: switch to GH CLI for uploading to releases I lost a few hours over the weekend because the GH release uploads are flakey and the action I was using doesn't internally perform retries. I had to manually delete the failed uploads from the release and then re-trigger the builds across several platforms, several times for both of the releases I pushed this weekend :-/ This commit speculatively switches over to using the GH cli in the hopes that the error reporting is better, and also because it is simpler to externally drive a retry loop. Let's see how this goes. --- .github/workflows/gen_centos7_continuous.yml | 12 +++--- .github/workflows/gen_centos7_tag.yml | 16 ++++---- .github/workflows/gen_centos8_continuous.yml | 12 +++--- .github/workflows/gen_centos8_tag.yml | 16 ++++---- .../workflows/gen_debian10.3_continuous.yml | 12 +++--- .github/workflows/gen_debian10.3_tag.yml | 19 +++++---- .github/workflows/gen_debian11_continuous.yml | 12 +++--- .github/workflows/gen_debian11_tag.yml | 19 +++++---- .../workflows/gen_debian9.12_continuous.yml | 12 +++--- .github/workflows/gen_debian9.12_tag.yml | 19 +++++---- .github/workflows/gen_fedora33_continuous.yml | 12 +++--- .github/workflows/gen_fedora33_tag.yml | 16 ++++---- .github/workflows/gen_fedora34_continuous.yml | 12 +++--- .github/workflows/gen_fedora34_tag.yml | 16 ++++---- .github/workflows/gen_fedora35_continuous.yml | 12 +++--- .github/workflows/gen_fedora35_tag.yml | 16 ++++---- .github/workflows/gen_macos_continuous.yml | 14 ++++--- .github/workflows/gen_macos_tag.yml | 20 ++++++---- .github/workflows/gen_ubuntu18_continuous.yml | 12 +++--- .github/workflows/gen_ubuntu18_tag.yml | 21 +++++----- .../workflows/gen_ubuntu20.04_continuous.yml | 12 +++--- .github/workflows/gen_ubuntu20.04_tag.yml | 19 +++++---- .github/workflows/gen_windows_continuous.yml | 12 +++--- .github/workflows/gen_windows_tag.yml | 18 ++++----- ci/create-release.sh | 4 ++ ci/generate-workflows.py | 39 ++++++++----------- ci/retry.sh | 18 +++++++++ 27 files changed, 225 insertions(+), 197 deletions(-) create mode 100755 ci/create-release.sh create mode 100755 ci/retry.sh diff --git a/.github/workflows/gen_centos7_continuous.yml b/.github/workflows/gen_centos7_continuous.yml index e60472b2b..608eea6f6 100644 --- a/.github/workflows/gen_centos7_continuous.yml +++ b/.github/workflows/gen_centos7_continuous.yml @@ -121,9 +121,9 @@ jobs: export BUILD_REASON=Schedule mv ~/rpmbuild/RPMS/*/*.rpm wezterm-nightly-centos7.rpm - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.rpm" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm diff --git a/.github/workflows/gen_centos7_tag.yml b/.github/workflows/gen_centos7_tag.yml index 625b4f984..d2b7430e2 100644 --- a/.github/workflows/gen_centos7_tag.yml +++ b/.github/workflows/gen_centos7_tag.yml @@ -84,11 +84,13 @@ jobs: - name: "Move RPM" shell: bash run: "mv ~/rpmbuild/RPMS/*/*.rpm ." - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.rpm" - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.rpm" diff --git a/.github/workflows/gen_centos8_continuous.yml b/.github/workflows/gen_centos8_continuous.yml index 7cb71bd75..f5df73d2f 100644 --- a/.github/workflows/gen_centos8_continuous.yml +++ b/.github/workflows/gen_centos8_continuous.yml @@ -108,9 +108,9 @@ jobs: export BUILD_REASON=Schedule mv ~/rpmbuild/RPMS/*/*.rpm wezterm-nightly-centos8.rpm - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.rpm" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm diff --git a/.github/workflows/gen_centos8_tag.yml b/.github/workflows/gen_centos8_tag.yml index 9ecaa276f..2e29c187e 100644 --- a/.github/workflows/gen_centos8_tag.yml +++ b/.github/workflows/gen_centos8_tag.yml @@ -70,11 +70,13 @@ jobs: - name: "Move RPM" shell: bash run: "mv ~/rpmbuild/RPMS/*/*.rpm ." - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.rpm" - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.rpm" diff --git a/.github/workflows/gen_debian10.3_continuous.yml b/.github/workflows/gen_debian10.3_continuous.yml index 7cf7dba27..c10834545 100644 --- a/.github/workflows/gen_debian10.3_continuous.yml +++ b/.github/workflows/gen_debian10.3_continuous.yml @@ -103,9 +103,9 @@ jobs: export BUILD_REASON=Schedule bash ci/deploy.sh - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz wezterm-*.tar.gz diff --git a/.github/workflows/gen_debian10.3_tag.yml b/.github/workflows/gen_debian10.3_tag.yml index 457ef28d0..40d3d3f73 100644 --- a/.github/workflows/gen_debian10.3_tag.yml +++ b/.github/workflows/gen_debian10.3_tag.yml @@ -67,14 +67,13 @@ jobs: - name: "Package" shell: bash run: "bash ci/deploy.sh" - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: | - wezterm-*.deb - wezterm-*.xz - wezterm-*.tar.gz - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.deb wezterm-*.xz wezterm-*.tar.gz" diff --git a/.github/workflows/gen_debian11_continuous.yml b/.github/workflows/gen_debian11_continuous.yml index 6c23bbc24..d141a5f91 100644 --- a/.github/workflows/gen_debian11_continuous.yml +++ b/.github/workflows/gen_debian11_continuous.yml @@ -103,9 +103,9 @@ jobs: export BUILD_REASON=Schedule bash ci/deploy.sh - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz wezterm-*.tar.gz diff --git a/.github/workflows/gen_debian11_tag.yml b/.github/workflows/gen_debian11_tag.yml index 71e6149ce..4f2d22728 100644 --- a/.github/workflows/gen_debian11_tag.yml +++ b/.github/workflows/gen_debian11_tag.yml @@ -67,14 +67,13 @@ jobs: - name: "Package" shell: bash run: "bash ci/deploy.sh" - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: | - wezterm-*.deb - wezterm-*.xz - wezterm-*.tar.gz - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.deb wezterm-*.xz wezterm-*.tar.gz" diff --git a/.github/workflows/gen_debian9.12_continuous.yml b/.github/workflows/gen_debian9.12_continuous.yml index 09803680e..3d40bed67 100644 --- a/.github/workflows/gen_debian9.12_continuous.yml +++ b/.github/workflows/gen_debian9.12_continuous.yml @@ -116,9 +116,9 @@ jobs: export BUILD_REASON=Schedule bash ci/deploy.sh - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz wezterm-*.tar.gz diff --git a/.github/workflows/gen_debian9.12_tag.yml b/.github/workflows/gen_debian9.12_tag.yml index b71d9d332..e2da34836 100644 --- a/.github/workflows/gen_debian9.12_tag.yml +++ b/.github/workflows/gen_debian9.12_tag.yml @@ -81,14 +81,13 @@ jobs: - name: "Package" shell: bash run: "bash ci/deploy.sh" - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: | - wezterm-*.deb - wezterm-*.xz - wezterm-*.tar.gz - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.deb wezterm-*.xz wezterm-*.tar.gz" diff --git a/.github/workflows/gen_fedora33_continuous.yml b/.github/workflows/gen_fedora33_continuous.yml index 40e02e250..142c83cce 100644 --- a/.github/workflows/gen_fedora33_continuous.yml +++ b/.github/workflows/gen_fedora33_continuous.yml @@ -98,9 +98,9 @@ jobs: export BUILD_REASON=Schedule mv ~/rpmbuild/RPMS/*/*.rpm wezterm-nightly-fedora33.rpm - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.rpm" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm diff --git a/.github/workflows/gen_fedora33_tag.yml b/.github/workflows/gen_fedora33_tag.yml index 27d29413e..856fdea9c 100644 --- a/.github/workflows/gen_fedora33_tag.yml +++ b/.github/workflows/gen_fedora33_tag.yml @@ -64,11 +64,13 @@ jobs: - name: "Move RPM" shell: bash run: "mv ~/rpmbuild/RPMS/*/*.rpm ." - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.rpm" - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.rpm" diff --git a/.github/workflows/gen_fedora34_continuous.yml b/.github/workflows/gen_fedora34_continuous.yml index e483abb1e..fd0ab4e24 100644 --- a/.github/workflows/gen_fedora34_continuous.yml +++ b/.github/workflows/gen_fedora34_continuous.yml @@ -98,9 +98,9 @@ jobs: export BUILD_REASON=Schedule mv ~/rpmbuild/RPMS/*/*.rpm wezterm-nightly-fedora34.rpm - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.rpm" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm diff --git a/.github/workflows/gen_fedora34_tag.yml b/.github/workflows/gen_fedora34_tag.yml index 25e019f3e..d6d9bb6e2 100644 --- a/.github/workflows/gen_fedora34_tag.yml +++ b/.github/workflows/gen_fedora34_tag.yml @@ -64,11 +64,13 @@ jobs: - name: "Move RPM" shell: bash run: "mv ~/rpmbuild/RPMS/*/*.rpm ." - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.rpm" - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.rpm" diff --git a/.github/workflows/gen_fedora35_continuous.yml b/.github/workflows/gen_fedora35_continuous.yml index 42d19f998..bf9ceb690 100644 --- a/.github/workflows/gen_fedora35_continuous.yml +++ b/.github/workflows/gen_fedora35_continuous.yml @@ -98,9 +98,9 @@ jobs: export BUILD_REASON=Schedule mv ~/rpmbuild/RPMS/*/*.rpm wezterm-nightly-fedora35.rpm - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.rpm" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm diff --git a/.github/workflows/gen_fedora35_tag.yml b/.github/workflows/gen_fedora35_tag.yml index 04813e900..370554a91 100644 --- a/.github/workflows/gen_fedora35_tag.yml +++ b/.github/workflows/gen_fedora35_tag.yml @@ -64,11 +64,13 @@ jobs: - name: "Move RPM" shell: bash run: "mv ~/rpmbuild/RPMS/*/*.rpm ." - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.rpm" - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.rpm" diff --git a/.github/workflows/gen_macos_continuous.yml b/.github/workflows/gen_macos_continuous.yml index ec0bd3005..99f6ac9e0 100644 --- a/.github/workflows/gen_macos_continuous.yml +++ b/.github/workflows/gen_macos_continuous.yml @@ -97,9 +97,11 @@ jobs: bash ci/deploy.sh - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "WezTerm-*.zip" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + export MACOSX_DEPLOYMENT_TARGET=10.9 + bash ci/retry.sh gh release upload --clobber nightly WezTerm-*.zip + diff --git a/.github/workflows/gen_macos_tag.yml b/.github/workflows/gen_macos_tag.yml index c1b520ea1..b12abbd19 100644 --- a/.github/workflows/gen_macos_tag.yml +++ b/.github/workflows/gen_macos_tag.yml @@ -69,14 +69,20 @@ jobs: run: | export MACOSX_DEPLOYMENT_TARGET=10.9 bash ci/deploy.sh - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: "WezTerm-*.zip" - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export MACOSX_DEPLOYMENT_TARGET=10.9 + bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }} + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export MACOSX_DEPLOYMENT_TARGET=10.9 + bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } WezTerm-*.zip - name: "Checkout homebrew tap" uses: actions/checkout@v2 with: diff --git a/.github/workflows/gen_ubuntu18_continuous.yml b/.github/workflows/gen_ubuntu18_continuous.yml index d4f55d2b6..331ac52fb 100644 --- a/.github/workflows/gen_ubuntu18_continuous.yml +++ b/.github/workflows/gen_ubuntu18_continuous.yml @@ -93,9 +93,9 @@ jobs: export BUILD_REASON=Schedule bash ci/appimage.sh - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz;*.AppImage;*.zsync" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz wezterm-*.tar.gz *.AppImage *.zsync diff --git a/.github/workflows/gen_ubuntu18_tag.yml b/.github/workflows/gen_ubuntu18_tag.yml index 2a89abdd1..093bd2453 100644 --- a/.github/workflows/gen_ubuntu18_tag.yml +++ b/.github/workflows/gen_ubuntu18_tag.yml @@ -61,19 +61,16 @@ jobs: - name: "Build AppImage" shell: bash run: "bash ci/appimage.sh" - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: | - wezterm-*.deb - wezterm-*.xz - wezterm-*.tar.gz - *.AppImage - *.zsync - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.deb wezterm-*.xz wezterm-*.tar.gz *.AppImage *.zsync" - name: "Checkout linuxbrew tap" uses: actions/checkout@v2 with: diff --git a/.github/workflows/gen_ubuntu20.04_continuous.yml b/.github/workflows/gen_ubuntu20.04_continuous.yml index 0ea246bb5..eed3663da 100644 --- a/.github/workflows/gen_ubuntu20.04_continuous.yml +++ b/.github/workflows/gen_ubuntu20.04_continuous.yml @@ -103,9 +103,9 @@ jobs: export BUILD_REASON=Schedule bash ci/deploy.sh - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly wezterm-*.deb wezterm-*.xz wezterm-*.tar.gz diff --git a/.github/workflows/gen_ubuntu20.04_tag.yml b/.github/workflows/gen_ubuntu20.04_tag.yml index 9ba1e5e78..5442789bf 100644 --- a/.github/workflows/gen_ubuntu20.04_tag.yml +++ b/.github/workflows/gen_ubuntu20.04_tag.yml @@ -67,14 +67,13 @@ jobs: - name: "Package" shell: bash run: "bash ci/deploy.sh" - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: | - wezterm-*.deb - wezterm-*.xz - wezterm-*.tar.gz - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.deb wezterm-*.xz wezterm-*.tar.gz" diff --git a/.github/workflows/gen_windows_continuous.yml b/.github/workflows/gen_windows_continuous.yml index f66e8e380..6b2c592c7 100644 --- a/.github/workflows/gen_windows_continuous.yml +++ b/.github/workflows/gen_windows_continuous.yml @@ -70,9 +70,9 @@ jobs: export BUILD_REASON=Schedule bash ci/deploy.sh - name: "Upload to Nightly Release" - uses: wez/upload-release-assets@releases/v1 - if: github.event.repository.fork == false - with: - files: "WezTerm-*.zip;WezTerm-*.exe" - release-tag: "nightly" - repo-token: "${{ secrets.GITHUB_TOKEN }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + export BUILD_REASON=Schedule + bash ci/retry.sh gh release upload --clobber nightly WezTerm-*.zip WezTerm-*.exe diff --git a/.github/workflows/gen_windows_tag.yml b/.github/workflows/gen_windows_tag.yml index 50f4e0ca2..1ba87e377 100644 --- a/.github/workflows/gen_windows_tag.yml +++ b/.github/workflows/gen_windows_tag.yml @@ -50,13 +50,13 @@ jobs: - name: "Package" shell: bash run: "bash ci/deploy.sh" - - name: "Upload to Tagged Release" - uses: softprops/action-gh-release@v1 - if: github.event.repository.fork == false - with: - files: | - WezTerm-*.zip - WezTerm-*.exe - prerelease: true + - name: "Create pre-release" env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" + - name: "Upload to Tagged Release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } WezTerm-*.zip WezTerm-*.exe" diff --git a/ci/create-release.sh b/ci/create-release.sh new file mode 100755 index 000000000..934885dad --- /dev/null +++ b/ci/create-release.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -x +name="$1" +gh release view "$name" || gh release create --prerelease --draft "$name" diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index 5ac733f91..bfc1607ca 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -167,10 +167,9 @@ class Target(object): def install_openssh_server(self): if self.uses_yum() or (self.uses_apt() and self.container): - return ( - [RunStep("Ensure /run/sshd exists", "mkdir -p /run/sshd")] - + self.install_system_package("openssh-server") - ) + return [ + RunStep("Ensure /run/sshd exists", "mkdir -p /run/sshd") + ] + self.install_system_package("openssh-server") return [] def install_newer_compiler(self): @@ -393,18 +392,13 @@ cargo build --all --release""", ) ) - patterns = self.asset_patterns() + patterns = " ".join(self.asset_patterns()) return steps + [ - ActionStep( + RunStep( "Upload to Nightly Release", - action="wez/upload-release-assets@releases/v1", - condition="github.event.repository.fork == false", - params={ - "files": ";".join(patterns), - "release-tag": "nightly", - "repo-token": "${{ secrets.GITHUB_TOKEN }}", - }, + f"bash ci/retry.sh gh release upload --clobber nightly {patterns}", + env={"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"}, ) ] @@ -414,18 +408,19 @@ cargo build --all --release""", if self.uses_yum(): steps.append(RunStep("Move RPM", "mv ~/rpmbuild/RPMS/*/*.rpm .")) - patterns = self.asset_patterns() + patterns = " ".join(self.asset_patterns()) return steps + [ - ActionStep( + RunStep( + "Create pre-release", + "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}", + env={"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"}, + ), + RunStep( "Upload to Tagged Release", - action="softprops/action-gh-release@v1", - condition="github.event.repository.fork == false", - params={"files": "\n".join(patterns), "prerelease": True}, - env={ - "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}", - }, - ) + f"bash ci/retry.sh gh release upload --clobber ${{ github.event.release.tag_name }} {patterns}", + env={"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"}, + ), ] def update_homebrew_tap(self): diff --git a/ci/retry.sh b/ci/retry.sh new file mode 100755 index 000000000..28c710a56 --- /dev/null +++ b/ci/retry.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -x +set -e + +max_attempts=10 +attempt=1 + +until "$@" +do + if (( attempt == max_attempts )) + then + echo "Failed after $max_attempts attempts" + exit 1 + fi + + sleep 5 + : $(( attempt++ )) +done