Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ jobs:
# No dependency cache in a release build: the artifact that goes to
# the registry should be built from a clean install every time.

# OIDC support landed in npm 11.5.x, newer than the npm bundled with
# Node 22, so upgrade explicitly. npm@latest needs Node ^22.22.2, which
# setup-node's "22" satisfies. Versions are echoed so a future runner
# image change is diagnosable from the log alone.
- name: Ensure npm supports OIDC
run: |
node --version
npm install -g npm@latest
npm --version

- name: Refuse to publish if the tag and package.json disagree
run: |
TAG="${GITHUB_REF_NAME#v}"
Expand All @@ -59,10 +49,25 @@ jobs:
exit 1
fi

# Install with the npm BUNDLED with Node 22 — the same npm ci.yml uses.
# npm 11 blocks dependency install scripts unless they are listed in
# allowScripts, which silently skips better-sqlite3's prebuild-install and
# leaves the native module unbuilt. Upgrading npm before this step is what
# broke the first two release attempts.
- run: npm ci
- run: npm run fixture
- run: npm test

# Only now upgrade npm: OIDC support landed in npm 11.5.x, newer than the
# npm bundled with Node 22. Publishing needs the new npm; installing needs
# the old one. Versions are echoed so a runner image change is
# diagnosable from the log alone.
- name: Ensure npm supports OIDC
run: |
node --version
npm install -g npm@latest
npm --version

# No NODE_AUTH_TOKEN. Authentication comes from the OIDC exchange, and
# provenance is attached automatically for a public repo + public package.
- run: npm publish
Loading