diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aac6578..97103cc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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}" @@ -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