Skip to content

Commit e382fbd

Browse files
chore: enhance release workflow to determine npm tag based on version suffix
1 parent a93cd80 commit e382fbd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@ jobs:
2929

3030
- run: pnpm build
3131

32-
- run: npm publish --provenance --access public
32+
- name: Determine npm tag
33+
id: npm-tag
34+
run: |
35+
if [[ "${{ github.ref_name }}" == *"-beta"* ]] || [[ "${{ github.ref_name }}" == *"-rc"* ]] || [[ "${{ github.ref_name }}" == *"-alpha"* ]]; then
36+
echo "tag=beta" >> $GITHUB_OUTPUT
37+
else
38+
echo "tag=latest" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: Publish to npm
42+
run: npm publish --provenance --access public --tag ${{ steps.npm-tag.outputs.tag }}
3343
env:
3444
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3545

0 commit comments

Comments
 (0)