Skip to content

Commit 50acc01

Browse files
committed
better publish
1 parent e7ab8a8 commit 50acc01

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/publish.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,15 @@ jobs:
423423
VSX_TAG="b2c-vs-extension@${{ steps.packages.outputs.version_vsx }}"
424424
425425
# Create a dedicated release for the extension (not latest — main releases own that)
426-
gh release create "$VSX_TAG" \
427-
--title "VS Code Extension ${{ steps.packages.outputs.version_vsx }}" \
428-
--latest=false \
429-
--notes "$(cat <<'NOTES'
426+
# Use --clobber on upload in case a previous run partially completed
427+
if gh release view "$VSX_TAG" >/dev/null 2>&1; then
428+
echo "Release $VSX_TAG already exists, uploading VSIX to it"
429+
gh release upload "$VSX_TAG" packages/b2c-vs-extension/*.vsix --clobber
430+
else
431+
gh release create "$VSX_TAG" \
432+
--title "VS Code Extension ${{ steps.packages.outputs.version_vsx }}" \
433+
--latest=false \
434+
--notes "$(cat <<'NOTES'
430435
## B2C DX VS Code Extension v${{ steps.packages.outputs.version_vsx }}
431436
432437
Download the \`.vsix\` file below and install via:
@@ -438,8 +443,9 @@ jobs:
438443
NOTES
439444
)"
440445
441-
# Upload the VSIX to the dedicated release
442-
gh release upload "$VSX_TAG" packages/b2c-vs-extension/*.vsix
446+
# Upload the VSIX to the dedicated release
447+
gh release upload "$VSX_TAG" packages/b2c-vs-extension/*.vsix
448+
fi
443449
env:
444450
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
445451

0 commit comments

Comments
 (0)