From 25f3614ef3c37534de541e1501a097e00425aaec Mon Sep 17 00:00:00 2001 From: Marcus Aram <4435760+marcusaram@users.noreply.github.com> Date: Fri, 30 Oct 2026 08:37:58 +0100 Subject: [PATCH 1/2] Release: fill a release that was made by hand on GitHub Making a release on GitHub also makes its tag, which starts the release workflow; gh release create then failed because the release existed. Now the files are uploaded to it, keeping its title, notes and pre-release mark. --- .github/workflows/release.yml | 6 ++++++ README.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c723700..e528593 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -103,6 +103,12 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | + # A release made by hand on GitHub (which also makes the tag) gets + # the files; its title, notes and pre-release mark stay as they are. + if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1; then + gh release upload "$GITHUB_REF_NAME" out/* --repo "$GITHUB_REPOSITORY" --clobber + exit 0 + fi # A tag with a suffix (v1.2.0-rc1) is a pre-release. pre=() case "$GITHUB_REF_NAME" in *-*) pre=(--prerelease) ;; esac diff --git a/README.md b/README.md index a3d7e74..a46cf13 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ git tag v0.16.0 git push origin v0.16.0 ``` -The release workflow then builds squirreld for every board, Squirrel Maker as a Mac app and as a command line program (with the packages a new card needs), and publishes them with their SHA-256 checksums as a GitHub release. A tag with a suffix, such as `v0.16.0-rc1`, becomes a pre-release. +The release workflow then builds squirreld for every board, Squirrel Maker for macOS and Windows (with the packages a new card needs), and publishes them with their SHA-256 checksums as a GitHub release. A tag with a suffix, such as `v0.16.0-rc1`, becomes a pre-release. A release made by hand on GitHub also makes the tag; the workflow then adds the files to it and leaves its title, notes and pre-release mark alone. Dependabot proposes newer Go modules and GitHub Actions once a week, as a pull request that CI tests. From 3d0b3df1d517acc1efaee61318d9bece7ca6acf1 Mon Sep 17 00:00:00 2001 From: Marcus Aram <4435760+marcusaram@users.noreply.github.com> Date: Fri, 30 Oct 2026 08:59:32 +0100 Subject: [PATCH 2/2] Release: fill a release that appears between the check and the create When gh release create fails, look again: if the release exists by now (another run, made by hand, or created before an upload failed), upload the files to it. Any other failure still fails the job. --- .github/workflows/release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e528593..2071548 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -112,5 +112,10 @@ jobs: # A tag with a suffix (v1.2.0-rc1) is a pre-release. pre=() case "$GITHUB_REF_NAME" in *-*) pre=(--prerelease) ;; esac - gh release create "$GITHUB_REF_NAME" out/* --repo "$GITHUB_REPOSITORY" \ - --title "Squirrel ${GITHUB_REF_NAME#v}" --generate-notes "${pre[@]}" + if ! gh release create "$GITHUB_REF_NAME" out/* --repo "$GITHUB_REPOSITORY" \ + --title "Squirrel ${GITHUB_REF_NAME#v}" --generate-notes "${pre[@]}"; then + # Made meanwhile (another run, or by hand): fill that one. Any + # other failure stays a failure. + gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1 || exit 1 + gh release upload "$GITHUB_REF_NAME" out/* --repo "$GITHUB_REPOSITORY" --clobber + fi