Skip to content

Commit f3f617f

Browse files
release: a re-run on a shipped tag gets past the release step (#133)
The first attempt at v0.1.174 cut the release and then stopped at the tap for want of a token. Setting the token and re-running could never work: `gh release create` fails when the release exists, and every step after it — the tap bump among them — was skipped. So the one situation a re-run exists for was the one it could not handle. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 36aed13 commit f3f617f

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,22 @@ jobs:
141141
echo "asset=/tmp/$NAME.tar.gz" >> "$GITHUB_OUTPUT"
142142
echo "name=$NAME.tar.gz" >> "$GITHUB_OUTPUT"
143143
144-
- name: Create the GitHub release
144+
# Re-runnable on a tag that already shipped.
145+
#
146+
# `gh release create` fails outright when the release exists, and every
147+
# step after it — the tap bump included — is skipped. That is exactly the
148+
# shape of a re-run: the first attempt cut the release and then died at
149+
# the tap for want of a token, and the retry could never get past here.
150+
- name: Create or update the GitHub release
145151
env:
146152
GH_TOKEN: ${{ github.token }}
147-
run: gh release create "${GITHUB_REF_NAME}" --generate-notes "${{ steps.build.outputs.asset }}"
153+
run: |
154+
if gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then
155+
echo "Release ${GITHUB_REF_NAME} exists — replacing its asset."
156+
gh release upload "${GITHUB_REF_NAME}" "${{ steps.build.outputs.asset }}" --clobber
157+
else
158+
gh release create "${GITHUB_REF_NAME}" --generate-notes "${{ steps.build.outputs.asset }}"
159+
fi
148160
149161
- name: Compute the tarball checksum
150162
id: sum

0 commit comments

Comments
 (0)