Release/v3.15.0 (#85) #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish v3 to NPM (latest) | |
| on: | |
| push: | |
| tags: | |
| - 'v3*' | |
| jobs: | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v3') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Ensure package version is 3.x.x | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "Detected version: $VERSION" | |
| case "$VERSION" in | |
| 3.*) echo "OK: version is 3.x.x" ;; | |
| *) echo "ERROR: package.json version must be 3.x.x for v3 tags" && exit 1 ;; | |
| esac | |
| - name: Publish to NPM with dist-tag "latest" | |
| run: npm run prepack && npm publish --tag latest --//registry.npmjs.org/:_authToken="$NPM_TOKEN" | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |