Skip to content

fix(release): upgrade npm for trusted publishing #8

fix(release): upgrade npm for trusted publishing

fix(release): upgrade npm for trusted publishing #8

Workflow file for this run

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