Skip to content

Release from stable branches, and publish only the versions a push changed - #9165

Merged
craigmichaelmartin merged 4 commits into
mainfrom
release-publish-pushed-versions
Nov 18, 2026
Merged

craigmichaelmartin merged 4 commits into
mainfrom
release-publish-pushed-versions

Conversation

@craigmichaelmartin

@craigmichaelmartin craigmichaelmartin commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Releases now ship from stable/X.Y branches: a Dev Experience member cuts stable/X.Y from a green main commit, the existing workflow opens its version bump there, QA tests that pull request's head, and merging it publishes. That gives every release a fixed, tested commit. The workflow also needs to stop two existing ways for untested code to reach npm:

  • It published whenever any public package's version was missing on npm. A release whose publish failed or only partly succeeded was then finished by the next unrelated push, from that push's newer tree.
  • main could publish too, so a version bump landing on main would publish whatever main held.

WHAT is this pull request doing?

  • Only stable/* publishes. On main, Check for unpublished versions fails when any version on main is missing from npm, and Publish to npm never runs.
  • A publish covers only the versions the push changed. The check compares each package.json with the push's previous commit and counts a package only if the push changed its version or made it public. Publish to npm marks every other package private for the run.
    • A version that an earlier push brought and npm still lacks gets a warning and isn't published. To finish it, re-run the failed jobs of that push's run, which builds the same commit.
    • A new Run workflow option, release, publishes the versions the branch's head commit changed against its first parent, for a push that started no run. If the head commit changed no version, it fails and says why.
  • The release must be the tested head. Before publishing, the job checks two things. The pushed commit must be the merge of this line's Version Packages pull request, from changeset-release/stable/X.Y. Its files must also be exactly that pull request head's. If the branch moved after the pull request was made, or the commit isn't that merge, it fails.
  • Version Packages refuses a version npm already has. That catches a line cut before main got the previous release back.
  • New workflow, Release QA package (release-qa-package.yml). Run by hand with a commit SHA, which must be the head of a branch here. It builds the @shopify/cli tarball the way the release does and uploads it as an artifact. It has read-only permissions, no secrets and no environment, and publishes nothing.
  • Removes the steps that created stable/X.Y after an X.Y.0 release, and corrects comments that described an npm-release approval step that no longer exists.

The same change is ready for stable/5.0 and stable/4.9, because each branch publishes with its own copy of this workflow.

How to manually test your changes?

  • After a merge, the next push to main shows every package "is on npm" and skips Publish to npm.
  • Run workflow on Release QA package with the head SHA of any branch here: the job uploads shopify-cli-<sha>, and gh run download <run-id> -R Shopify/cli -n shopify-cli-<sha> fetches it.
  • For a release: merge a Version Packages - stable/X.Y pull request with a merge commit while the branch is still at the head's parent. Publish to npm logs "Publishing the files of ".

🤖 Generated with Claude Code

A release whose publish failed was finished by the next push, from that push's newer tree. The
check now counts only packages whose version the push changed, or that it made public, and the
publish job marks every other package private for the run. A version an earlier push brought is
finished by re-running that push's run, or by the new `release` option of a manual run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@craigmichaelmartin
craigmichaelmartin requested a review from a team as a code owner November 18, 2026 16:35
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Nov 18, 2026
craigmichaelmartin and others added 2 commits November 18, 2026 11:37
A manual run published every unpublished version at the branch's head, so a version whose push
was followed by later commits went out from the newer tree. It now publishes only the versions the
head commit changed against its first parent, and fails with the reason otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main no longer publishes releases: its check fails when a version on it is missing from npm, and
releases ship from stable/* through a merged Version Packages pull request. The publish job checks
that the merge's tree is the pull request head's, version-packages refuses a version npm already
has, and a new manual workflow builds the release tarball of a given commit for testing. The
stable-branch creation steps are removed: Dev Experience creates stable/X.Y by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@craigmichaelmartin craigmichaelmartin changed the title Publish only the versions a push changed Release from stable branches, and publish only the versions a push changed Nov 18, 2026
A merge commit whose files equal its second parent's proves the line didn't move, not that the
merged head was the tested pull request: a hand-made merge pushed directly also passes. The publish
job now also requires the commit to be the merge of a pull request from changeset-release/<line>
into the line, with that head. npm reads are retried so a registry blip doesn't read as missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@craigmichaelmartin
craigmichaelmartin added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 437fd46 Nov 18, 2026
29 checks passed
@craigmichaelmartin
craigmichaelmartin deleted the release-publish-pushed-versions branch November 18, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants