Skip to content

Commit fec15cd

Browse files
zeroedinclaude
andcommitted
ci: make release workflow idempotent and rerunnable
Use force-tag and gh release upload --clobber so reruns replace existing assets instead of failing. Allows manual reruns to fix partial releases (e.g. missing Homebrew tap update). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e0c74a9 commit fec15cd

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,27 @@ jobs:
9292
rm -rf LICENSE THIRD_PARTY_LICENSES
9393
sha256sum * > checksums.txt
9494
95+
- name: Create or update tag
96+
env:
97+
VERSION: ${{ steps.version.outputs.version }}
98+
run: |
99+
TAG="v${VERSION}"
100+
git tag -f "$TAG"
101+
git push origin "$TAG" --force
102+
95103
- name: Create GitHub Release
96104
env:
97105
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98106
VERSION: ${{ steps.version.outputs.version }}
99107
run: |
100-
gh release create "v${VERSION}" dist/* \
101-
--title "v${VERSION}" \
102-
--notes-file /tmp/release-notes.md
108+
TAG="v${VERSION}"
109+
if gh release view "$TAG" >/dev/null 2>&1; then
110+
gh release upload "$TAG" dist/* --clobber
111+
else
112+
gh release create "$TAG" dist/* \
113+
--title "$TAG" \
114+
--notes-file /tmp/release-notes.md
115+
fi
103116
104117
- name: Update Homebrew tap
105118
continue-on-error: true

0 commit comments

Comments
 (0)