Skip to content

Commit f9aa0e8

Browse files
committed
[chore] Set NPM tag based on release tag
Fix rjsf-team#4602 by conditionally setting the tag in the release action
1 parent 7d9171c commit f9aa0e8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ jobs:
2626
env:
2727
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2828
- run: git update-index --assume-unchanged .npmrc
29-
- run: npx nx release publish
29+
- name: Determine npm tag based on release version
30+
id: get_npm_tag
31+
run: |
32+
TAG_NAME="${{ github.ref_name }}"
33+
NPM_TAG_VALUE="latest" # Default tag
34+
35+
if [[ "$TAG_NAME" == *alpha* || "$TAG_NAME" == *beta* || "$TAG_NAME" == *pre* ]]; then
36+
NPM_TAG_VALUE="next"
37+
fi
38+
39+
echo "NPM_TAG=${NPM_TAG_VALUE}" >> $GITHUB_ENV
40+
echo "Determined NPM_TAG: ${NPM_TAG_VALUE}"
41+
- run: npx nx release publish --tag=$NPM_TAG
3042
- if: always()
3143
run: rm .npmrc

0 commit comments

Comments
 (0)