ci: release to npm on tag push (trusted publishing, mirrors kernel/cua) - #2
Conversation
Adds a release workflow that publishes the package to npm on a `v*` tag push. Mirrors the kernel/cua release flow: OIDC trusted publishing (no npm token), tag-must-be-on-main and version-matches-tag guards, and a pack + ESM-import smoke test before publish. Node 24 to match engines. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
74cca90 to
0fead09
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0fead09. Configure here.
| node --input-type=module -e "import('@onkernel/eve-extension').then((m) => { if (typeof m.default !== 'function') process.exit(1); })" | ||
|
|
||
| - name: Publish to npm | ||
| run: npm publish --access public |
There was a problem hiding this comment.
OIDC publish blocked by registry-url
High Severity
The actions/setup-node step, when configured with registry-url, writes an .npmrc entry for _authToken using an unset NODE_AUTH_TOKEN. This empty token entry then takes precedence, preventing npm's OIDC trusted publishing from engaging, which causes npm publish to fail with ENEEDAUTH.
Reviewed by Cursor Bugbot for commit 0fead09. Configure here.
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write |
There was a problem hiding this comment.
First publish impossible via OIDC
High Severity
The workflow authenticates only via trusted publishing OIDC and never wires NODE_AUTH_TOKEN / NPM_TOKEN. npm still cannot publish the initial version of a package that does not exist yet over OIDC, and this package is not on npm, so the first release cannot succeed.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0fead09. Configure here.


Summary
The repo had no release/publish flow — only
ci.yml(build/typecheck/pack on PRs), and the package isn't on npm yet. This adds arelease.ymlthat publishes@onkernel/eve-extensionto npm on av*tag push.Modeled on the kernel/cua release workflows (
release-cua-ai.ymletc.), collapsed to a single package:v*), not a GitHub Release.id-token: write+npm@^11.5.1,npm publishwith no npm token. (Confirmed working in practice:@onkernel/cua-ai@latestis published byGitHub ActionsviatrustedPublisher: githubusing this exact shape.)main, andpackage.jsonversion must equal the tag (v<version>).npm pack→ ESM-import smoke test (installs the tarball + theevepeer and imports the default export).engines.node.One-time bootstrap (required — package is new)
OIDC trusted publishing can't perform the first publish of a package that doesn't exist yet (you can't configure a trusted publisher on a non-existent package). kernel/cua hit the same wall — hence its
bootstrap: 0.0.1dist-tag. So before the first CI release, a maintainer with@onkernelpublish rights does a one-time manual publish, then wires trusted publishing:Then in the npm package settings → Trusted Publisher → GitHub Actions, repo
kernel/eve-extension, workflowrelease.yml. After that, every real release goes through CI over OIDC — no token.How to release (steady state)
versioninpackage.json, merge tomain.v<version>(e.g.v0.1.0) and push the tag → workflow builds, verifies, and publisheslatest.Bugbot findings
@onkernel/cua-ai@0.7.0publishes via OIDC withregistry-urlset and no token; npm ≥11.5.1 ignores the empty_authTokenand engages OIDC.Verified locally (Node 24)
npm ci→preparebuildsdist/cleanly;npm run typecheckpassesnpm pack→ 13 files (dist + README + LICENSE + package.json, 20.9 kB unpacked)eve@^0.25,import('@onkernel/eve-extension')resolves anddefaultis a functionNote
Medium Risk
Adds automated public npm publishing with supply-chain gates, but a mis-tagged or wrongly configured trusted publisher could still ship a bad release; operational one-time bootstrap is required before OIDC can publish a new package.
Overview
Introduces
.github/workflows/release.yml, a release pipeline that runs when av*tag is pushed.The job enforces that the tagged commit is on
mainand thatpackage.jsonversion matches the tag (without thevprefix), then runsnpm ci, build, typecheck,npm pack, and an ESM smoke test (install tarball +evepeer, import default export) beforenpm publish --access public.Publishing uses npm OIDC trusted publishing (
id-token: write, global npm ≥11.5.1, no stored npm token) with Node 24 and a per-tag concurrency group so overlapping releases for the same tag do not cancel each other.Reviewed by Cursor Bugbot for commit 062c788. Bugbot is set up for automated code reviews on this repo. Configure here.