v0.2.4 #5
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 | |
| on: | |
| release: | |
| types: | |
| - published | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| concurrency: | |
| group: publish-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| name: Publish package | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24.x | |
| registry-url: https://registry.npmjs.org | |
| cache: npm | |
| - name: Show tool versions | |
| run: | | |
| node --version | |
| npm --version | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Test | |
| run: npm test | |
| - name: Build | |
| run: npm run build | |
| - name: Verify committed dist is current | |
| run: git diff --exit-code -- dist | |
| - name: Verify package contents | |
| run: npm pack --dry-run | |
| - name: Verify release tag matches package version | |
| if: github.event_name == 'release' | |
| run: node -e "const pkg = require('./package.json'); const expected = 'v' + pkg.version; if (process.env.GITHUB_REF_NAME !== expected) { console.error('Release tag ' + process.env.GITHUB_REF_NAME + ' does not match package version ' + expected); process.exit(1); }" | |
| - name: Dry-run publish | |
| if: github.event_name == 'workflow_dispatch' | |
| run: npm publish --access public --provenance --dry-run | |
| - name: Publish to npm | |
| if: github.event_name == 'release' | |
| run: npm publish --access public --provenance |