From 719336d43a6b71958e259e6911eff883912a4d5e Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 15 Sep 2025 09:33:37 -0500 Subject: [PATCH] test butler early in CI --- .github/workflows/mac-universal.yml | 5 +++++ .github/workflows/release.yml | 5 +++++ .github/workflows/scripts/butler_push.sh | 14 +++++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mac-universal.yml b/.github/workflows/mac-universal.yml index 874e2ccd..dd97ff90 100644 --- a/.github/workflows/mac-universal.yml +++ b/.github/workflows/mac-universal.yml @@ -28,6 +28,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: test butler + run: './.github/workflows/scripts/butler_push.sh test' + shell: bash + if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release' && matrix.os.name != 'macos' }} + # Download macos-intel - uses: robinraju/release-downloader@v1 id: download diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 796c432e..a93a4201 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,6 +60,11 @@ jobs: uses: actions/checkout@v4 with: submodules: true + - name: test butler + run: './.github/workflows/scripts/butler_push.sh test' + shell: bash + if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release' && matrix.os.name != 'macos' }} + - name: Download dependency build uses: robinraju/release-downloader@v1 with: diff --git a/.github/workflows/scripts/butler_push.sh b/.github/workflows/scripts/butler_push.sh index b780e1bd..49972e84 100755 --- a/.github/workflows/scripts/butler_push.sh +++ b/.github/workflows/scripts/butler_push.sh @@ -1,5 +1,8 @@ #! /bin/bash +# Pass any argument to make it a dry run (for putting at the start of your CI, to catch failure early) +test="${1}" + butler_channel="" butler_exe="" release_dir="" @@ -30,11 +33,16 @@ fi # Butler download is disabled because something is wrong with the automated download links ## -L follows redirects ## -O specifies output name -# curl -L -o butler.zip https://broth.itch.ovh/butler/${butler_channel}/LATEST/archive/default -# unzip butler.zip +# if [ ! -f ./${butler_exe} ]; then +# curl -L -o butler.zip https://broth.itch.ovh/butler/${butler_channel}/LATEST/archive/default +# unzip butler.zip +# fi # GNU unzip tends to not set the executable bit even though it's set in the .zip chmod +x ${butler_exe} # just a sanity check run (and also helpful in case you're sharing CI logs) ./${butler_exe} -V -./${butler_exe} push "build/Blades of Exile/" nqn/blades-of-exile:${release_dir} + +if [ -z "$test" ]; then + ./${butler_exe} push "build/Blades of Exile/" nqn/blades-of-exile:${release_dir} +fi \ No newline at end of file