We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 035477f commit 99bbaf5Copy full SHA for 99bbaf5
.github/workflows/publish.yml
@@ -28,7 +28,19 @@ jobs:
28
- name: Build
29
run: npm run build
30
31
+ - name: Determine npm tag
32
+ id: npm-tag
33
+ run: |
34
+ VERSION=$(node -p "require('./package.json').version")
35
+ if [[ "$VERSION" == *"-"* ]]; then
36
+ # Prerelease version - extract tag (e.g., "alpha" from "0.0.1-alpha.0")
37
+ TAG=$(echo "$VERSION" | sed 's/.*-\([a-zA-Z]*\).*/\1/')
38
+ echo "tag=$TAG" >> $GITHUB_OUTPUT
39
+ else
40
+ echo "tag=latest" >> $GITHUB_OUTPUT
41
+ fi
42
+
43
- name: Publish
- run: npm publish --provenance --access public
44
+ run: npm publish --provenance --access public --tag ${{ steps.npm-tag.outputs.tag }}
45
env:
46
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
0 commit comments