Repository navigation
feat(release): publish nightly and stable releases through npm trusted publishing - #3380
Conversation
|
Size Report
Startup median (7 runs, lower is better):
|
|
The release checks are green at 61567a6 (33 checks, none failing, including the macOS release:prepare dry run), but one publishing gap needs a fix before merge. I did not run the new tests locally. I could not exercise the nightly, promote or stable route either, because the OIDC exchange, the deployment policy and the approval gate only show up on main after setup. npm trust is pinned to Not blocking, and fine to take or leave: the workflow test at release-workflow.test.ts:20 checks which jobs can mint an id-token but not the approval gate, so removing Is there a smaller design? I did not find one that keeps these properties, and the two-hop promotion (tag, then dispatch) looks justified because the stable run gets the exact promoted commit as its sha and provenance. Could #3381 land with or right after this PR, so the old local-publish path is removed and two copies do not sit on main? The merge needs the environment and tag protections in place and documented first. |
61567a6 to
365abaa
Compare
365abaa to
7b8e5c3
Compare
|
Addressed. A GitHub-side check now gates publishing. Blocking item. The plan cannot protect anything by itself, as you said. GitHub has to enforce the gates, so:
Non-blocking items. Both are fixed at
#3381 lands right after this one in the stack. |
7b8e5c3 to
9c6ef86
Compare
|
Changed the stable flow at the maintainer's request. A stable release now publishes the commit its |
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
The earlier findings from 61567a6 are fixed at 9c6ef86, and I found no new blocking problems in the code. CI shows 33 checks reported and none failing at 9c6ef86. The changed release.yml route (nightly or stable publish) cannot run on a PR, so CI only exercises the dry-run mode. I did not run the tests locally. I judged the earlier regressions by reading the pre-delta code. Repository settings (v* ruleset, release reviewers, npm-publish deployment policy) are not applied yet, per the author, and the #3388 guard is in the stacked PR, not this head. I also could not check that a GitHub release published from the UI with a new tag fires the On the open threads: the "mark-released push skips CI" thread (#3380 (comment)) and the "unanchored test match" thread (#3380 (comment)) still apply. Three lower-priority threads still apply as well. These threads do not apply, so you can resolve them: the MCP registry tag check (#3380 (comment)) never limited what a writer could register, and the helper and runner version-equality threads (#3380 (comment) and #3380 (comment)) would fail every stable run because the tagged commit carries X.Y.Z-dev. Not blocking: in the new stable flow, an admin who publishes the GitHub release first makes it public before the CI gate at release-plan.mjs:60 and the To merge, please answer the thread on the mark-released push (#3380 (comment)). That bump commit is pushed with GITHUB_TOKEN, so it never gets a ci.yml run, and the stable CI gate added here, like the nightly gate, refuses any commit without one. Push with a token that starts workflows, or treat that commit as covered by its parent's CI. |
9c6ef86 to
e18c816
Compare
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
e18c816 to
498ff88
Compare
…d publishing .github/workflows/release.yml owns every npm publish. A schedule publishes main's HEAD under the nightly dist-tag once CI passed; dispatching stable promotes the latest nightly's commit to X.Y.Z, then publishes the GitHub release, its assets, and the MCP Registry entry, and moves main to the next -dev version. Only the publish job can mint an id-token, and no npm token is involved.
…e approval gate The publisher treats only npm's E404 as "not published" and rethrows any other registry failure. Promotion reuses a tag that already points at the promoted commit, so re-running a failed dispatch succeeds. The workflow test now fails if a stable publish stops waiting for the release environment approval.
A stable release starts from a vX.Y.Z tag on main that a repository admin creates, normally by publishing a GitHub release targeting main. The stable run now also requires green CI on that commit. This replaces the promote job and the GITHUB_TOKEN tag it created. Nightly tags move to nightly/v*, outside the admin-only v* tags and the npm-publish tag policy.
…e plan The workflow's -dev bump is pushed with GITHUB_TOKEN, so it never gets a CI run. A main commit with no CI run now stands on its parent's CI when it only rewrites version fields, so nightlies and stable releases keep working after a release. A stable tag waits up to 20 minutes for its commit's CI, the npm nightly dist-tag also blocks a second nightly that UTC day, version patterns reject leading zeros, and the approval test pins the publish condition exactly.
…r not created yet
498ff88 to
db9484f
Compare
|
The two blocking threads are fixed in
The other three applicable threads are fixed too: leading zeros, the npm On the non-blocking note about publishing the release before CI finishes: a stable tag now waits up to 20 minutes for its commit's CI, so a release published right after a merge waits for that merge's CI instead of failing. The release is still public before approval. CONTRIBUTING says to delete the release and tag if you reject the run, or to push the tag instead, in which case the run drafts the release itself. |
|
The PR is ready at db9484f. The earlier findings from 9c6ef86 are fixed: the bump commit now inherits its parent's CI result, the npm nightly dist-tag check is in place, the version segment checks reject leading zeros, and the publish condition matches its test. Not blocking: you can take or leave these. First, the tests only cover The review threads from cubic-dev-ai no longer apply, since each is fixed at this commit, so please resolve them: release-plan.mjs wait states, release-workflow publish condition, bump inherits parent CI, leading-zero version segments, and npm nightly dist-tag. CI is still pending. The only check not passing is I did not run a stable tag release or a scheduled nightly against the live GitHub and npm APIs. I checked the polling loop and the bump-to-parent recursion by reading the code only. I also assumed the commits API leaves out the |
Summary
.github/workflows/release.ymlnow owns every npm publish, through npm trusted publishing. No npm token or one-time password is involved.X.Y.Z-nightly.<date>.<run>under thenightlydist-tag whenmainhas changed, its CI passed, and no nightly shipped that UTC day. The workflow tags the commitnightly/v…, and the npm dist-tag serves as the durable record.vX.Y.Ztag targetingmain. Only admins may createv*tags (chore(release): retire local npm publishing #3381 documents the ruleset). The tag's run waits up to 20 minutes for that commit's CI, then for approval in thereleaseenvironment. It then:latestmain's next-devversion. That commit is pushed withGITHUB_TOKEN, so it gets no CI run of its own; it counts as covered by its parent's CI because it only rewrites"version"fields.publish(environmentnpm-publish) and the MCP Registry call can mint an id-token.test/ci/release-workflow.test.tspins that, and pins the exact approval condition.The layer above (#3388) refuses to publish until GitHub enforces these protections. 12 files.
Validation
At
db9484fff6:chore: mark 0.21.24 as releasedcommit and false for a code commit.v0.21.24.release:preparedry run passed at9c6ef86.