Repository navigation
ci(npm): publish @wailsio/runtime via Trusted Publishing (OIDC) - #5646
Conversation
The publish-npm workflow has failed at the npm publish step on every run since ~Feb 2026 (npm E404 on PUT = NPM_TOKEN not authorized for the @wailsio scope), so master's runtime version climbed to alpha.90 while npm stayed frozen at alpha.79 — which lacks the Android runtime bridge and breaks JS<->Go bindings for every stock 'wails3 init' Android app. Switch to npm Trusted Publishing (OIDC): - add id-token: write for the OIDC token + provenance - upgrade npm to >= 11.5.1 (required for trusted publishing) - replace JS-DevTools/npm-publish + NPM_TOKEN with plain 'npm publish' Requires a Trusted Publisher configured for @wailsio/runtime on npmjs.com (repo wailsapp/wails, workflow publish-npm.yml).
|
Caution Review failedPull request was closed or merged during review WalkthroughThe Changesnpm Publish OIDC Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…auto-commit sponsor image (#5647) * ci(npm): publish prerelease as latest + bump CI Node to 22 The OIDC migration (#5646) authenticates correctly but `npm publish` fails on npm >= 11 with 'You must specify a tag using --tag when publishing a prerelease version' — the old JS-DevTools action defaulted to `latest` implicitly. v3 intentionally ships alpha.N as the default dist-tag (the templates pin "@wailsio/runtime": "latest"), so publish with --tag latest. Also bump the CI Node from the deprecated 20 to 22 (LTS). * ci(npm): verify generated artifacts + commit regenerated runtime to master Harden the publish flow per the existing regenerate-before-publish design: - add a Verify step that fails the job if (re)generation didn't produce the expected outputs (bundled runtime + npm dist/), catching silent build failures before anything is published or committed. - make the commit-back explicit: 'git add -A' sweeps every regenerated tracked file (bundled runtime in internal/assetserver/bundledassets, generated pkg/events/events.go, TypeDoc output) back to master alongside the version bump; log 'git status' so the committed set is visible. dist/ is gitignored and is rebuilt fresh by prepack at publish time. * ci(sponsors): auto-commit sponsor image instead of opening a PR Push the regenerated website/static/img/sponsors.svg straight to master (no-op when unchanged) using the bypass-capable WAILS_REPO_TOKEN, matching publish-npm.yml, rather than opening a daily 'update sponsors' PR. Also modernise the actions (checkout v3->v4, setup-node v2->v4, Node 20->22). --------- Co-authored-by: Lea Anthony <[email protected]>
Problem
publish-npm.ymlhas failed at thePublish npm packagestep on every run since ~Feb 2026. The earlier steps (build → bump → commit → push) succeed, so master's runtime version climbed to alpha.90 while npm stayed frozen at alpha.79 (last good publish 2026-01-25).The failure is npm E404 on
PUT https://registry.npmjs.org/@wailsio%2fruntime— npm's disguised authorization failure (404 not 403 to avoid leaking package existence). I.e.secrets.NPM_TOKENis no longer authorized to publish the@wailsioscope.Impact: alpha.79 predates the Android runtime bridge (
window.wails.invokeAsync), so JS↔Go bindings are broken for every stockwails3 initAndroid app — the runtime falls back tofetch('/wails/runtime'), whose POST body the Android WebView drops → HTTP 422missing object value.Fix
Migrate to npm Trusted Publishing (OIDC) — no long-lived token to rot:
id-token: writefor the OIDC token + automatic provenanceJS-DevTools/npm-publish+NPM_TOKENwith plainnpm publish --access publicRequired out-of-band step (done)
A Trusted Publisher is configured for
@wailsio/runtimeon npmjs.com: orgwailsapp, repowails, workflowpublish-npm.yml, empty environment.Effect
One successful run ships alpha.91 (master already has the bridge); templates pin
"latest", so all stock Android users are fixed.Validated with
actionlint(clean) + YAML parse. End-to-end publish only testable in CI after merge.Summary by CodeRabbit