Skip to content

Make the release workflow publish-only - #1453

Merged
charlespwd merged 1 commit into
mainfrom
cpc-15/publish-only-release
Dec 2, 2026
Merged

charlespwd merged 1 commit into
mainfrom
cpc-15/publish-only-release

Conversation

@charlespwd

Copy link
Copy Markdown
Contributor

In this PR

release.yml stops opening release PRs and only publishes. When a commit on main has no pending changeset and carries versions that npm doesn't have yet, it publishes them, pushes the tags and creates the GitHub releases, as today.

Merge order: this PR sits on #1452 (Changesets 3), and must merge after the next release PR has merged and published. Once this lands, nothing opens or updates a release PR here.

Problem

Releases will be versioned before they reach this repository. A release PR opened and merged on GitHub would then be a second source of versions on main.

Solution

On every push to main, changesets/action/select-mode picks a mode:

Mode When What runs
publish no changeset pending, and a version isn't on npm npm publish with provenance, tags, GitHub releases
version changesets pending nothing. The run fails if a version is also not on npm (below)
none nothing pending, nothing new for npm nothing for npm
  • A version bump with changesets still pending fails the run. Publishing that commit would ship changes its changelog doesn't list. The error names each version that isn't on npm:
    Changesets are still pending, so nothing was published. Not on npm yet: @shopify/theme-graph@0.3.11
    
  • Three publish jobs. publish-npm, publish-extension and publish-crates each start from select-mode, so a crates.io failure doesn't stop the npm, VS Code Marketplace or Open VSX publish. The extension and crates jobs run in publish and none mode, and compare their versions with their registries as today, because the extension and the crates aren't on npm.
  • Permissions. The workflow token is contents: read. Only publish-npm gets contents: write, for tags and releases, and id-token: write for trusted publishing.
  • Concurrency. Runs queue (queue: max) and never cancel, so a newer push can't cut a run between the npm publish and the tags. actionlint doesn't know queue yet and flags it; GitHub accepts it.
  • Removed: the release PR step and its date title, and the OIDC test step. vscode-release.yml stays as the manual way to publish the extension.

publish-crates is unchanged. It keeps failing at the token exchange until crates.io trusted publishing is set up for this repository.

Validation

I ran select-mode from changesets/action at the pinned commit, and the new check's script taken from this workflow, on a copy of this branch:

State Mode Check
This branch: no changeset, versions match npm none not run
After pnpm release with a test changeset publish not run. The local run stops at the publish plan upload, which needs the Actions runtime
A pending changeset, no version bump version passes, nothing publishes
A pending changeset and a bumped @shopify/theme-graph version fails with the message above

Not tested: a real publish. Only a push to main runs it.

@charlespwd charlespwd self-assigned this Dec 1, 2026
@charlespwd
charlespwd added this pull request to stack #1459 December 1, 2026 17:03
@charlespwd
charlespwd marked this pull request as ready for review December 1, 2026 17:06
@charlespwd
charlespwd requested a review from a team as a code owner December 1, 2026 17:06
Base automatically changed from cpc-15/changesets-3 to main December 1, 2026 20:43
Release versions will reach main already versioned, from a release PR
that this workflow no longer opens. On each push to main it now only
publishes what the commit versioned.

- `changesets/action/select-mode` picks the mode. In `publish` mode,
  `changesets/action/publish` publishes to npm, pushes the tags and
  creates the GitHub releases, as before.
- While a changeset is pending, the run fails if a version is not on
  npm yet, and publishes nothing: that commit's changelog would not list
  every change it ships.
- The npm, extension and crates publishes are separate jobs, so one
  failing does not stop the others.
- The workflow token is read-only by default. Only the npm job can
  write tags and releases.
@charlespwd
charlespwd force-pushed the cpc-15/publish-only-release branch from 9d2af0e to 4b809d7 Compare December 1, 2026 20:43
@charlespwd
charlespwd enabled stacked auto-merge (squash) December 2, 2026 15:55
@charlespwd
charlespwd merged commit 6a94272 into main Dec 2, 2026
10 checks passed
@charlespwd
charlespwd deleted the cpc-15/publish-only-release branch December 2, 2026 16:41
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.

2 participants