You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phase 6g: add publish-nodejs to release.yml (npm via OIDC) (#28)
Two new jobs following the Phase 6f pattern:
- build-nodejs-binaries (matrix, 4 cells)
- publish-nodejs (aggregate + npm publish + GitHub Release)
**Bundled-binaries architecture**: the `sqlrite` npm package ships
every platform's `.node` binary inside one tarball (~15 MiB),
picked at require time by napi's generated `index.js` dispatcher
based on process.platform / process.arch. Simpler than managing
N+1 npm packages (main + one per platform) — the cost is a bigger
download, acceptable for a database driver people install once.
**Why build/publish split**: same reason as publish-python — if
each matrix cell ran `npm publish` independently, a mid-matrix
failure would leave npm with some-but-not-all binaries and no
clean rollback. Aggregator downloads every platform's `.node`
binary into sdk/nodejs/ alongside the napi-generated `index.js`
dispatcher (uploaded by the Linux x86_64 cell only — it's
identical across build platforms), then does one atomic
`npm publish --provenance`.
**Matrix** mirrors publish-ffi / publish-desktop / publish-python
so all publish jobs share one consistent OS/arch pattern:
ubuntu-latest → linux-x64-gnu (sqlrite.linux-x64-gnu.node)
ubuntu-24.04-arm → linux-arm64-gnu (sqlrite.linux-arm64-gnu.node)
macos-latest → darwin-arm64 (sqlrite.darwin-arm64.node)
windows-latest → win32-x64-msvc (sqlrite.win32-x64-msvc.node)
**Authentication via npm OIDC trusted publishing** — zero
long-lived NPM_TOKEN. The publish-nodejs job has `permissions:
id-token: write` and lives in the `release` GitHub environment.
npm-side config is one-time trusted-publisher registration on
npmjs.com (docs/release-secrets.md). `--provenance` flag attaches
a sigstore-signed attestation linking the published package to
this exact GitHub Actions run — npm's equivalent of PyPI's
PEP 740 attestations that worked first-try in the v0.1.4 canary.
**Wiring:**
- tag-all → pushes sqlrite-node-v<V>
- finalize → needs publish-nodejs
- umbrella release body → 🟢 Node.js link with npm + per-product
release pointers
Verified locally: `cargo check -p sqlrite-nodejs` clean,
release.yml parses as valid YAML, npm name `sqlrite` available
(404 on registry.npmjs.org). Existing package.json already names
it `sqlrite` and has the `sqlrite.*.node` glob in `files`, so no
SDK source changes needed.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Authentication via PyPI trusted publishing (OIDC) — zero long-lived tokens. `permissions: id-token: write` on the publish job plus the `release` GitHub environment (one-time trusted-publisher config on PyPI's web UI, documented in `docs/release-secrets.md`).
421
421
422
-
### Phase 6g — Node.js SDK publish
422
+
### ✅ Phase 6g — Node.js SDK publish
423
423
424
-
Adds `publish-nodejs` job. `@napi-rs/cli` builds `.node` binaries per platform; npm publish via OIDC.
424
+
Adds two jobs to `release.yml` — `build-nodejs-binaries` (matrix of 4 platforms) + `publish-nodejs` (aggregator + npm upload + GitHub Release).
425
+
426
+
**Bundled-binaries architecture**: the main `sqlrite` npm package ships every platform's `.node` binary inside one tarball (~15 MiB), not the per-platform optional-dep packages `@napi-rs/*` projects use. Simpler for an MVP (one npm publish, one package to manage); the tradeoff is a bigger install, acceptable for a database driver people install once. The `index.js` dispatcher napi generates picks the right binary at require time via `process.platform` + `process.arch`.
427
+
428
+
Same build/publish split as publish-python — matrix cells upload `.node` artifacts, a single aggregator job downloads everything into `sdk/nodejs/`, runs `npm publish --provenance` once. `--provenance` attaches a sigstore-signed attestation linking the published package to this exact workflow run (npm's equivalent of PyPI's PEP 740).
429
+
430
+
Authentication via npm OIDC trusted publishing — zero long-lived `NPM_TOKEN`. One-time trusted-publisher registration on npmjs.com, documented in `docs/release-secrets.md`.
0 commit comments