File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,11 +69,24 @@ jobs:
6969 - name : Pack
7070 run : ./scripts/npm-pack.sh
7171
72+ - name : Determine dist-tag
73+ id : dist-tag
74+ run : |
75+ VERSION=$(node -p "require('./package.json').version")
76+ if [[ "$VERSION" == *-* ]]; then
77+ # Pre-release version (e.g. 1.9.0-alpha.0) — extract pre-release label
78+ TAG=$(echo "$VERSION" | sed 's/.*-\([a-zA-Z]*\).*/\1/')
79+ echo "tag=$TAG" >> $GITHUB_OUTPUT
80+ else
81+ echo "tag=latest" >> $GITHUB_OUTPUT
82+ fi
83+ echo "Version: $VERSION, Tag: $(cat $GITHUB_OUTPUT | grep tag | cut -d= -f2)"
84+
7285 - name : Publish
7386 run : |
7487 if [[ "${{ inputs.dry_run }}" == "true" ]]; then
7588 echo "=== DRY RUN ==="
76- npm publish --provenance --access public --dry-run ./dist/rclnodejs-*.tgz
89+ npm publish --provenance --access public --tag ${{ steps.dist-tag.outputs.tag }} -- dry-run ./dist/rclnodejs-*.tgz
7790 else
78- npm publish --provenance --access public ./dist/rclnodejs-*.tgz
91+ npm publish --provenance --access public --tag ${{ steps.dist-tag.outputs.tag }} ./dist/rclnodejs-*.tgz
7992 fi
You can’t perform that action at this time.
0 commit comments