1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 13:16:39 +03:00

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.
This commit is contained in:
Wez Furlong 2021-12-06 09:11:26 -07:00
parent 15dcfa4c48
commit 1e8ebdadfd
27 changed files with 225 additions and 197 deletions

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

4
ci/create-release.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
set -x
name="$1"
gh release view "$name" || gh release create --prerelease --draft "$name"

View File

@ -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):

18
ci/retry.sh Executable file
View File

@ -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