Skip to content

Commit 4a0e308

Browse files
DevRohit06claude
andcommitted
fix(ci): handle pre-existing releases in GitHub Actions
If a release was already created manually, upload build assets to it instead of failing with "release already exists" error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0220c38 commit 4a0e308

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,14 @@ jobs:
6565
GH_TOKEN: ${{ github.token }}
6666
run: |
6767
tag="${GITHUB_REF#refs/tags/}"
68-
gh release create "$tag" dist/* \
69-
--title "$tag" \
70-
--generate-notes
68+
if gh release view "$tag" &>/dev/null; then
69+
echo "Release $tag already exists, uploading assets..."
70+
gh release upload "$tag" dist/* --clobber
71+
else
72+
gh release create "$tag" dist/* \
73+
--title "$tag" \
74+
--generate-notes
75+
fi
7176
7277
pypi-publish:
7378
needs: build

0 commit comments

Comments
 (0)