ci: use node 24 for npm trusted publishing #2
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 npm Package | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Verify tag matches package version | |
| shell: bash | |
| run: | | |
| PACKAGE_VERSION="$(node -p "require('./package.json').version")" | |
| if [ "v${PACKAGE_VERSION}" != "${GITHUB_REF_NAME}" ]; then | |
| echo "Tag ${GITHUB_REF_NAME} does not match package.json version v${PACKAGE_VERSION}" | |
| exit 1 | |
| fi | |
| - name: Smoke test release package | |
| run: npm run release:smoke | |
| - name: Verify package contents | |
| run: npm run release:check | |
| - name: Publish package to npm | |
| run: npm publish --access public |