Phase 6h: add publish-wasm to release.yml (npm @joaoh82/sqlrite-wasm via OIDC)#36
Merged
Phase 6h: add publish-wasm to release.yml (npm @joaoh82/sqlrite-wasm via OIDC)#36
Conversation
Adds a single publish-wasm job alongside the existing publish-* chain. Unlike the Python / Node SDKs, WASM doesn't need a per-platform binary matrix — WebAssembly is one universal artifact that runs on any wasm32-capable host (browsers, Deno, modern bundlers). One build, one upload. **Scoped name preemptively (`@joaoh82/sqlrite-wasm`):** the unscoped `sqlrite-wasm` is currently free on npm but the similarity check that rejected `sqlrite` (vs `sqlite`) might also reject `sqlrite-wasm` (vs `sqlite-wasm`, distance 1). Going scoped from day one matches the Node SDK's `@joaoh82/sqlrite` decision and avoids the rename dance we did in PR #30. Free to revisit if the ecosystem demands unscoped. **Build target = `bundler`:** webpack/vite/rollup/parcel users get JS modules + .wasm without extra config. `web` / `nodejs` / `deno` targets can be added as siblings later if there's demand; one target per package is the simpler MVP shape. **Job structure** (single cell, no matrix): - install Rust + wasm32-unknown-unknown target - cargo install wasm-pack via the curl|sh installer (binstall isn't preinstalled on ubuntu-latest; the official installer is one less moving piece) - actions/setup-node WITHOUT registry-url (same lesson learned in publish-nodejs across v0.1.5–v0.1.7 — registry-url forces token-auth and bypasses OIDC) - npm install -g npm@latest (need 11.5+ for trusted publishing) - wasm-pack build --release --target bundler --scope joaoh82 → produces sdk/wasm/pkg/ with auto-generated package.json naming the package @joaoh82/sqlrite-wasm - OIDC env diagnostics step (proven valuable on v0.1.7) - npm publish --access public --provenance --loglevel verbose from sdk/wasm/pkg - upload .wasm to sqlrite-wasm-vX.Y.Z GitHub Release **Wiring:** - tag-all → pushes sqlrite-wasm-v<V> - finalize.needs → extended with publish-wasm - umbrella release body → 🌐 WASM entry pointing at npm + GitHub Release **Docs:** - sdk/wasm/README.md — install via @joaoh82/sqlrite-wasm, callout explaining the scoped name choice, source-build docs unchanged for `web` / `nodejs` / `deno` targets - docs/roadmap.md — Phase 6h marked done with the design rationale captured - docs/release-secrets.md §3 — rewritten to reflect what we actually learned in v0.1.5–v0.1.7: npm DOES require placeholder publish before trusted publisher can be configured (no PyPI-style pending publisher on npm), and the form fields must exactly match the OIDC subject claim (typoed repo name burned us once on v0.1.7) - sdk/wasm/src/lib.rs, docs/embedding.md, docs/release-plan.md, examples/README.md, root README.md — install command + package name updated everywhere After this merges, user does the one-time npm placeholder publish + trusted-publisher registration for @joaoh82/sqlrite-wasm (per docs/release-secrets.md §3a + 3b), then v0.1.8 canary validates publish-wasm end-to-end. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a single
publish-wasmjob torelease.ymlthat builds the WASM package viawasm-packand publishes to npm as@joaoh82/sqlrite-wasmusing OIDC trusted publishing.publish-wasmNo matrix — WebAssembly is one universal artifact that runs on any wasm32-capable host. One build, one upload.
Design choices
Scoped name preemptively (
@joaoh82/sqlrite-wasm)The unscoped
sqlrite-wasmis currently free on npm but the same similarity check that rejectedsqlrite(vssqlite, distance 1) might also rejectsqlrite-wasm(vssqlite-wasm, distance 1). Going scoped from day one matches the Node SDK's@joaoh82/sqlritedecision (PR #30) and avoids a possible rename dance. Free to revisit if the ecosystem demands unscoped.Build target =
bundlerWebpack/vite/rollup/parcel users get JS modules + .wasm directly.
web/nodejs/denotargets can be added as siblings later if there's demand; one target per package is the simpler MVP.Inherits all the OIDC lessons from publish-nodejs
The job uses the exact same npm publish recipe we landed on after the v0.1.5–v0.1.7 debugging cycle:
registry-urlon setup-node (would force token-auth, bypassing OIDC)npm install -g npm@latest(need 11.5+ for trusted publishing)npm publish --access public --provenance --loglevel verbose(--provenancetriggers OIDC code path,--access publicfor scoped packages, verbose for diagnosable errors)Wiring
sqlrite-wasm-v<V>added totag-allpublish-wasmadded tofinalize.needsDocs updated
docs/release-secrets.md§3 — rewritten end-to-end to reflect what we actually learned in v0.1.5–v0.1.7 (npm DOES require placeholder publish before trusted publisher config; form fields must exactly match OIDC subject claim with the right exact format). Now covers both scoped npm packages.docs/roadmap.md— Phase 6h marked done with design rationale.sdk/wasm/README.md— install via@joaoh82/sqlrite-wasm, callout explaining the scoped-name choice.sqlrite-wasmupdated acrossexamples/README.md,docs/embedding.md,docs/release-plan.md,sdk/wasm/src/lib.rs, rootREADME.md.Test plan
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/release.yml'))"— YAML parsescargo checkinsdk/wasm/— clean (existing unused-mut warnings unrelated)@joaoh82/sqlrite-wasmreturns 404 on registry.npmjs.org@joaoh82/sqlrite-wasm@0.0.0placeholder (same flow as@joaoh82/sqlriteperdocs/release-secrets.md§3a —npm login+npm publish --access publicfrom a temp dir with a 4-line package.json)docs/release-secrets.md§3b — Repository:rust_sqlite(basename only), Workflow:release.yml(basename only), Environment:release)@joaoh82/sqlrite-wasm@0.1.8lands on npm + sigstore provenance vianpm audit signatures🤖 Generated with Claude Code