-
Notifications
You must be signed in to change notification settings - Fork 429
Publish preview releases with changesets prerelease mode #3888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: preview
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json", | ||
| "$schema": "https://unpkg.com/@changesets/config@4.0.0-next.6/schema.json", | ||
| "changelog": "@changesets/cli/changelog", | ||
| "commit": false, | ||
| "fixed": [], | ||
| "linked": [], | ||
| "access": "public", | ||
| "baseBranch": "main", | ||
| "baseBranch": "preview", | ||
| "updateInternalDependencies": "patch", | ||
| "ignore": ["@shopify/hydrogen-example-*", "hydrogen"] | ||
| "ignore": ["@shopify/hydrogen-example-*", "hydrogen", "@shopify/storefront-e2e"], | ||
| "format": false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. non-blocking: the declared 3.1.4 schema doesn't know about
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed! |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "mode": "pre", | ||
| "tag": "preview", | ||
| "changesets": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # This file must be named release.yml: npm's Trusted Publishing configuration | ||
| # for our packages allows a single workflow filename, shared across branches. | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [preview] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. non-blocking: (threading) this merge creates the version PR; it doesn't publish until that PR merges. Phase 0 can therefore land separately, but it must land before the generated version PR. The React Router template still needs the deploy flags that bypass the released CLI's
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call. I'm going to fire up another PR for this. Edit: actually I'll do it in #3890 |
||
|
|
||
| concurrency: | ||
| group: release-${{ github.ref_name }} | ||
| # Queue runs instead of cancelling: a cancel that lands between npm | ||
| # publish and tag creation strands state a rerun cannot rebuild | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| preview-release: | ||
| name: Preview Release | ||
| runs-on: ubuntu-latest | ||
| if: github.repository_owner == 'shopify' | ||
| permissions: | ||
| contents: write # push the version branch and create git tags | ||
| pull-requests: write # open and update the version PR | ||
| id-token: write # generate an ID token for npm Trusted Publishing | ||
| env: | ||
| npm_config_registry: https://registry.npmjs.org/ | ||
| TURBO_TELEMETRY_DISABLED: "1" | ||
| outputs: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: these outputs aren't consumed by any job in this workflow. Fine to keep if Phase we will use them soon, but for now they do nothing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are intentional — the upcoming dist-preview work hooks a compile job onto this one with |
||
| published: ${{ steps.changesets.outputs.published }} | ||
| publishedPackages: ${{ steps.changesets.outputs.publishedPackages }} | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| # Changesets needs full history to generate changelogs with the correct commits | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 | ||
| with: | ||
| version: 10.33.0 | ||
|
|
||
| - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | ||
| with: | ||
| node-version-file: package.json | ||
| registry-url: "https://registry.npmjs.org" | ||
| cache: pnpm | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Ensure prerelease mode | ||
| # Without pre.json, changeset publish would push a non-prerelease | ||
| # version to the npm latest dist-tag, hijacking it from the real | ||
| # releases published from main | ||
| run: jq -e '.mode == "pre" and .tag == "preview"' .changeset/pre.json | ||
|
|
||
| - name: Ensure no major changesets | ||
| # Preview releases move only the -preview.<n> suffix; a major | ||
| # changeset would move the base version off 2026.10.0 | ||
| run: node scripts/assert-no-major-changesets.ts | ||
|
|
||
| - name: Build packages | ||
| run: pnpm run build:pkgs | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blocking: publication isn't gated on the full CI suite. CI runs as a sibling workflow, and
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the CI check to the preview branch protection required status checks, so the version PR cannot merge while CI is red or still running. I think that covers this without duplicating the whole suite inside the release job. |
||
|
|
||
| - name: Create preview release PR or publish | ||
| id: changesets | ||
| uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0 | ||
| with: | ||
| version: pnpm changeset version | ||
| publish: pnpm changeset publish | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blocking: (threading) the root
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch — the pinned CLI throws "Releasing under custom tag is not allowed in pre mode!" on the explicit flag. Dropped |
||
| commit: "[ci] preview release" | ||
| title: "[ci] preview release" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} | ||
| NPM_TOKEN: "" # Empty string forces OIDC authentication | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "@shopify/hydrogen", | ||
| "version": "0.0.1", | ||
| "version": "2026.10.0-preview.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's port main's Hydrogen changelog before the first version PR merges, otherwise
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would rather do this when it is time for the main release instead of for preview. Retrofitting is a one-file paste at that point, and preview's changelog can stay self-contained until then. |
||
| "description": "Framework-agnostic Shopify storefront SDK and agent skills.", | ||
| "license": "MIT", | ||
| "author": "Shopify", | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc
format: falseonly avoids formatting changelog markdown, it doesn't formatpre.jsonlet's also add
.changeset/pre.jsontooxfmt.config.ts'signorePatterns?