Skip to content

feat(ci): publish a release when its release PR merges - #1651

Merged
vivek7405 merged 2 commits into
mainfrom
feat/auto-release-on-merge
Oct 28, 2026
Merged

vivek7405 merged 2 commits into
mainfrom
feat/auto-release-on-merge

Conversation

@vivek7405

Copy link
Copy Markdown
Collaborator

Closes #1650

A merged release PR publishes on its own again. release.yml now also runs on workflow_run when the CI workflow completes green for a push to main, checks out that exact commit, and publishes the changelog files it added: npm, GitHub Packages, the GitHub Releases, and the lockstep wrappers. scripts/release.sh and the publish-* tag stay as the manual and recovery paths.

Why it was manual

#1594 moved CI off Actions onto the maintainer machine and left Actions only the npm publish (trusted publishing is bound to release.yml), so the rest of the release moved to scripts/release.sh. CI has since moved back to Actions and scripts/ci-merge.sh waits for it, so the release can follow CI on the merge commit, which is the same check release.sh made by hand.

Guards

  • Only a green CI run for a push publishes: a red run and a PR CI run never do (job-level if:).
  • The checkout is workflow_run.head_sha, not the current tip of main, so HEAD~1..HEAD is the release commit even if main moved on.
  • The changelog diff runs before setup and install; a push with no changelog file stops after a checkout and a git diff.
  • concurrency: release-<sha> queues an automatic run and a manually pushed tag for the same commit.
  • test/repo-health/release-workflow-trigger.test.mjs pins all of that, including that workflow_run.workflows equals the name: of ci.yml; each of the eight properties was broken in turn and turned the test red.

Process change

The release gate (node scripts/release-gate.mjs) now runs on the release PR head before merging (as done for #1649) rather than in release.sh after it. Docs updated: framework-dev.md, AGENTS.md, the start-work skill, ci-merge.sh, release.sh, the global-update hook.

Caveat

workflow_run reads the workflow file from the default branch, so this takes effect for release merges after it lands. Trusted publishing from a workflow_run-triggered run of the same release.yml file is the one thing only a real release can prove; if the first one does not publish, scripts/release.sh still works unchanged.

t added 2 commits October 28, 2026 02:33
Since #1594 moved CI to the maintainer machine, release.yml ran only on a
pushed publish-* tag, so every release needed scripts/release.sh after the
merge. CI is back on Actions, so release.yml now also runs on workflow_run
when the CI workflow completes green for a push to main, checks out that
exact commit, and publishes the changelog files it added: npm, GitHub
Packages, the GitHub Releases (back in the workflow with contents: write)
and the lockstep wrappers. The changelog diff runs before setup and
install, so a push with no changelog file costs a checkout and a git diff.
One run per commit through a concurrency group, so an automatic run and a
manually pushed tag queue instead of racing. The tag and dispatch triggers
stay as the manual and recovery paths.

The repo-health test pins every property whose loss would stop releases
or publish the wrong commit, each with a counterfactual.

Closes #1650
framework-dev.md, AGENTS.md, the start-work skill, ci-merge.sh, release.sh
and the global-update hook described the manual release.sh flow as the only
way to publish. The release gate now runs on the release PR head before the
merge, the publish follows CI on the merge commit, and release.sh is the
manual fallback.

Refs #1650
@vivek7405 vivek7405 self-assigned this Oct 27, 2026
@pilots-run

pilots-run Bot commented Oct 27, 2026

Copy link
Copy Markdown

Preview for 6d03863 was not built: compose file has unsupported keys

Next: fix the listed keys in the compose file

@vivek7405
vivek7405 merged commit 0243120 into main Oct 28, 2026
10 of 11 checks passed
@vivek7405
vivek7405 deleted the feat/auto-release-on-merge branch October 28, 2026 03:23
vivek7405 added a commit that referenced this pull request Oct 28, 2026
* ci: purge the CDN on Actions for every push to main again

#1594 moved the webjs.dev purge from purge-cdn.yml to the merging
machine, where ci-merge.sh started scripts/purge-cdn.sh in the
background. That skipped silently whenever the shell lacked
CLOUDFLARE_API_TOKEN or held an expired Railway login, and never ran
for a merge done anywhere else; the purges for #1649 and #1651 both
failed that way. CI is on Actions again and the repository secrets are
still set, so the workflow's push trigger comes back unchanged.

ci-merge.sh no longer starts a local purge, release.sh purges only with
--purge, and purge-cdn.sh stays as the manual tool.

Closes #1652

* docs: point purge-cdn.sh at the automatic workflow

---------

Co-authored-by: t <t@t>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish a release automatically when its release PR merges

1 participant