Skip to content

feat: switch to changesets release PR workflow - #951

Open
kdaviduik wants to merge 1 commit into
mainfrom
03-13-chore_delete_deploying.md
Open

feat: switch to changesets release PR workflow#951
kdaviduik wants to merge 1 commit into
mainfrom
03-13-chore_delete_deploying.md

Conversation

@kdaviduik

@kdaviduik kdaviduik commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Part of https://github.com/Shopify/developer-tools-team/issues/1195


Summary

  • Delete DEPLOYING.md (info is now in CONTRIBUTING.md instead))
    • Almost all of the previous information in DEPLOYING.md was no longer accurate now that there's a changeset release PR rather than a release happening upon merging into main
  • Create CLAUDE.md and AGENTS.md as symlinks to CONTRIBUTING.md so that we have a single source of truth for all of this information and agents automatically "see" it
  • Rewrite npm-release.yml for the changesets release PR pattern: pending changesets create a [ci] release PR; merging that PR triggers npm publish

Why

The previous workflow published to npm immediately on PR merge. This made it extremely un-ergonomic to batch multiple merchant-facing changes in a single release, and required workarounds (like adding [DOCS] to the PR title) to avoid releasing a new Buy Button JS version when there were zero code changes. The release PR pattern (used by Hydrogen and many Shopify repos) creates an intermediate PR showing exactly what will be published and is the more modern, preferred way of managing releases.

External prerequisite

SHOPIFY_GH_ACCESS_TOKEN has been provisioned via github-actions-access-provider#2613

Comment thread CONTRIBUTING.md

If your PR doesn't need a new npm release (docs-only changes, test updates, CI changes, etc.), just don't include a changeset. No changeset = no release PR = no npm publish.

### Rollback (update `latest` CDN version)

@kdaviduik kdaviduik Mar 18, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's extremely rare that we'd need/want to do this, but this was in the old DEPLOYING.md and is helpful to have just in case, especially the info like how to purge the CDN cache

@@ -1,29 +1,31 @@
name: Release new NPM version
name: Release

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is very similar to Hydrogen's release.yml workflow

@kdaviduik
kdaviduik force-pushed the 03-13-chore_delete_deploying.md branch from 215a2cc to 5ebe7c7 Compare March 18, 2026 19:01
Base automatically changed from enable-auto-changelog to main August 6, 2026 21:17
Comment thread .changeset/config.json
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be public since this is a public package on npm, docs

@kdaviduik
kdaviduik force-pushed the 03-13-chore_delete_deploying.md branch from 5ebe7c7 to e8de275 Compare August 22, 2026 00:08
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
fetch-depth: 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why fetch-depth: 0 instead of the default 1?

fetch-depth: 1 (the checkout action's default) does a shallow clone — only the latest commit, no history, no tags. fetch-depth: 0 fetches the entire git history including all branches and tags.

This is required here because the changesets/action step (changeset version + changeset publish) depends on:

  1. Git tags — Changesets uses tags to determine which version to publish and to create GitHub releases. A shallow clone doesn't fetch them.
  2. Full commit history — When generating the release PR, Changesets inspects commits since the last release to build changelog entries and determine which packages changed.

With the default fetch-depth: 1, you'd hit errors like "could not find tag" and end up with empty/incomplete changelogs.

@kdaviduik
kdaviduik marked this pull request as ready for review August 22, 2026 00:11
@kdaviduik
kdaviduik requested a review from a team as a code owner August 22, 2026 00:11
Replace the direct-publish npm release workflow with the two-mode
changesets/action pattern: pending changesets create a release PR
titled "[ci] release"; merging it triggers npm publish.

Why: the previous workflow published to npm immediately on PR merge.
This made it impossible to batch multiple changes from separate PRs
in a single npm release, and also meant that authors who didn't
realize that PR merge = release could accidentally publish to npm
a change that isn't ready for release.

The release PR pattern creates an intermediate PR showing exactly
what will be published before it goes out.
@kdaviduik
kdaviduik force-pushed the 03-13-chore_delete_deploying.md branch from e8de275 to 1873514 Compare August 22, 2026 00:30
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.

1 participant