Skip to content

Commit 70cc6a0

Browse files
committed
fix: add smart npm tag detection to resolve publishing issues
- Automatically detect prerelease versions (beta, alpha, rc) - Apply appropriate npm tags based on version type - Explicitly specify tag for all publishes to avoid auto-tag issues - Maintain compatibility with both stable and prerelease workflows
1 parent 62d3d78 commit 70cc6a0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,21 @@ jobs:
7878
7979
- name: Publish to NPM (production releases only)
8080
if: github.event_name == 'push'
81-
run: npm publish --access public
81+
run: |
82+
VERSION="${{ steps.get_version.outputs.VERSION }}"
83+
# Determine the appropriate npm tag based on version
84+
if [[ "$VERSION" == *"-beta"* ]]; then
85+
NPM_TAG="beta"
86+
elif [[ "$VERSION" == *"-alpha"* ]]; then
87+
NPM_TAG="alpha"
88+
elif [[ "$VERSION" == *"-rc"* ]]; then
89+
NPM_TAG="rc"
90+
else
91+
# For stable releases, explicitly use latest tag
92+
NPM_TAG="latest"
93+
fi
94+
echo "📦 Publishing to NPM with tag: $NPM_TAG"
95+
npm publish --access public --tag "$NPM_TAG"
8296
env:
8397
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8498

0 commit comments

Comments
 (0)