0.7.1 #21
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: release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: write # to create the GitHub Release | |
| id-token: write # OIDC token used by npm trusted publishing | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org/ | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build | |
| - run: npm test | |
| - name: Verify package.json version matches the tag | |
| run: | | |
| tag="${GITHUB_REF#refs/tags/v}" | |
| pkg=$(node -p "require('./package.json').version") | |
| if [ "$tag" != "$pkg" ]; then | |
| echo "tag $tag does not match package.json $pkg" >&2 | |
| exit 1 | |
| fi | |
| # OIDC trusted publishing requires npm >= 11.5.1. Invoke via npx | |
| # so we always get a recent enough CLI without mutating the | |
| # global npm install on the runner. | |
| - run: npx -y npm@latest publish --access public | |
| - uses: softprops/action-gh-release@v3 | |
| with: | |
| generate_release_notes: true |