We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents eceb44d + bf8be9b commit aafb1e9Copy full SHA for aafb1e9
1 file changed
.github/workflows/publish-npm.yml
@@ -42,5 +42,17 @@ jobs:
42
- name: Update npm
43
run: npm install -g npm@latest
44
45
- - run: npm publish
+ - name: Determine npm tag
46
+ id: npm-tag
47
+ run: |
48
+ PACKAGE_VERSION=$(node -p "require('./javascript/package.json').version")
49
+ LATEST_VERSION=$(npm view @ruby/prism version 2>/dev/null || echo "0.0.0")
50
+ if npx semver "$PACKAGE_VERSION" -r ">$LATEST_VERSION"; then
51
+ echo "tag=latest" >> "$GITHUB_OUTPUT"
52
+ else
53
+ MINOR=$(echo "$PACKAGE_VERSION" | cut -d. -f1,2)
54
+ echo "tag=stable-$MINOR" >> "$GITHUB_OUTPUT"
55
+ fi
56
+
57
+ - run: npm publish --tag ${{ steps.npm-tag.outputs.tag }}
58
working-directory: javascript
0 commit comments