fix(release): upgrade npm for trusted publishing #8
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 TypeScript package | |
| on: | |
| push: | |
| tags: | |
| - "typescript-v*" | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| registry-url: https://registry.npmjs.org | |
| cache: npm | |
| - run: npm ci | |
| - name: Verify tag matches package version | |
| run: test "${GITHUB_REF_NAME#typescript-v}" = "$(node -p 'require("./package.json").version')" | |
| # better-sqlite3 owns native resources whose cleanup can race Jest workers | |
| # on Node 24. Serial execution keeps the release verification deterministic. | |
| - run: npm test -- --runInBand | |
| - run: npm run build | |
| - name: Upgrade npm for trusted publishing | |
| run: npm install --global npm@latest | |
| - run: npm publish --access public |