ci: make release upload idempotent

Change-Id: I826fcc302c0ea20877c66045e1e264efa7dbb3d5
This commit is contained in:
wujunchen 2026-05-09 11:16:59 +08:00
parent 04428950de
commit d00075779e

View file

@ -44,7 +44,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
gh release create "$tag" \
--title "$tag" \
--generate-notes \
main.js main.js.map manifest.json styles.css
if gh release view "$tag" >/dev/null 2>&1; then
gh release upload "$tag" --clobber main.js main.js.map manifest.json styles.css
else
gh release create "$tag" \
--title "$tag" \
--generate-notes \
main.js main.js.map manifest.json styles.css
fi