Skip to content

Commit cf58782

Browse files
fix(ci): add --tag alpha for npm prerelease publish
npm requires --tag for prerelease versions, otherwise defaults to latest which is rejected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dcf7cd9 commit cf58782

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,13 @@ jobs:
3131
run: npm install -g npm@latest
3232
- name: Remove temp npmrc so npm uses OIDC
3333
run: rm -f "$NPM_CONFIG_USERCONFIG"
34-
- run: npm publish --provenance --access public
34+
- name: Determine npm tag
35+
id: tag
36+
run: |
37+
VERSION=$(node -p "require('./package.json').version")
38+
if echo "$VERSION" | grep -qE 'alpha|beta|rc'; then
39+
echo "tag=alpha" >> $GITHUB_OUTPUT
40+
else
41+
echo "tag=latest" >> $GITHUB_OUTPUT
42+
fi
43+
- run: npm publish --provenance --access public --tag ${{ steps.tag.outputs.tag }}

0 commit comments

Comments
 (0)