Skip to content

Commit a0bc99b

Browse files
phernandezclaude
andcommitted
fix: add --tag for prerelease npm publishes
npm 11+ requires --tag for prerelease versions to avoid tagging as latest. Auto-detects prerelease (alpha, beta, rc) from version string. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c2c01c5 commit a0bc99b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ jobs:
7676
git push origin "${{ steps.bump.outputs.tag }}"
7777
7878
- name: Publish to npm
79-
run: npm publish --provenance --access public
79+
run: |
80+
VERSION="${{ steps.bump.outputs.version }}"
81+
if [[ "$VERSION" == *-* ]]; then
82+
DIST_TAG="${VERSION##*-}" # e.g. alpha.6 -> alpha
83+
DIST_TAG="${DIST_TAG%%.*}" # strip .N suffix
84+
npm publish --provenance --access public --tag "$DIST_TAG"
85+
else
86+
npm publish --provenance --access public
87+
fi
8088
8189
- name: Create GitHub release
8290
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)