You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
with no human review gate for version bumps or changelogs. The release
PR pattern creates an intermediate PR showing exactly what will be
published before it goes out.
Key changes:
- Rewrite npm-release.yml to use changesets/action v1.7.0
- Switch trigger to push-to-main with queue concurrency
- Use SHOPIFY_GH_ACCESS_TOKEN (GITHUB_TOKEN can't re-trigger workflows)
- Add full git history fetch and registry-url for npm auth
- Enable @changesets/changelog-github for automatic changelog generation
- Add @changesets/changelog-github devDependency
- Set .changeset/config.json access to "public"
- Delete DEPLOYING.md (content moved to CONTRIBUTING.md)
- Add deploy/release/rollback docs to CONTRIBUTING.md
- Update CLAUDE.md and AGENTS.md symlinks to point to CONTRIBUTING.md
- Fix CHANGELOG.md v3.0.6 date from "(Unreleased)" to 2025-08-25
- Remove manual changeset detection and [ROLLBACK]/[DOCS] skip logic
Co-Authored-By: Claude <noreply@anthropic.com>
We ❤️ pull requests. If you'd like to fix a bug, contribute a feature or
3
4
just correct a typo, please feel free to do so, as long as you follow
4
5
our [Code of Conduct](https://github.com/Shopify/js-buy-sdk/blob/main/CODE_OF_CONDUCT.md).
5
6
6
7
If you're thinking of adding a big new feature, consider opening an
7
8
issue first to discuss it to ensure it aligns to the direction of the
8
9
project (and potentially save yourself some time!).
10
+
11
+
## Deploying and publishing
12
+
13
+
### Publishing a new version
14
+
15
+
1. Pull from main and install dependencies:
16
+
```
17
+
git pull origin main
18
+
pnpm install
19
+
```
20
+
2. Create a changeset describing your changes:
21
+
```
22
+
pnpm exec changeset add
23
+
```
24
+
3. Commit the changeset file alongside your code changes. **Do NOT manually update `CHANGELOG.md`** — it is generated automatically from changesets.
25
+
4. Push and create a PR. **Do NOT bump the version in `package.json`** — changesets manages this.
26
+
5. Merge the PR into `main`. The release workflow will automatically create a release PR titled `[ci] release`.
27
+
6. Review the release PR — verify the version bump and `CHANGELOG.md` are correct.
28
+
7. Merge the release PR. The release workflow will automatically publish the new version to npm and create a GitHub release.
29
+
8. Deploy via [Shipit](https://shipit.shopify.io/shopify/buy-button-js/production) to publish the new version to Shopify's CDN. Press "Deploy", read and tick off the checkbox, then create and monitor the deploy.
30
+
31
+
### Non-release changes
32
+
33
+
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.
34
+
35
+
### Rollback (update `latest` CDN version)
36
+
37
+
Follow these steps to roll back the `latest` CDN version without publishing a normal npm release.
38
+
39
+
1. Create a branch from `main` and revert the faulty code changes
40
+
2. Do **not** include a changeset file. Verify no stale `.changeset/*.md` files exist (other than `README.md`):
41
+
```
42
+
ls .changeset/*.md
43
+
```
44
+
If any exist, delete them — stale changesets would cause the release workflow to open a release PR instead of a clean rollback.
45
+
3. Append `-ROLLBACK` to the version in `package.json` (e.g., `3.0.6` → `3.0.6-ROLLBACK`)
46
+
4. Run `pnpm install` to update the lockfile
47
+
5. Stage and commit your changes
48
+
6. Create a tag matching the new version:
49
+
```
50
+
git tag 3.0.6-ROLLBACK
51
+
```
52
+
7. Push the branch and tags:
53
+
```
54
+
git push && git push --tags
55
+
```
56
+
8. Create and merge the PR
57
+
9. Deploy via [Shipit](https://shipit.shopify.io/shopify/buy-button-js/production)
58
+
10. Purge the CDN cache via [Infra Central](https://infra-central.shopify.io/edge/purges):
> The `-ROLLBACK` prerelease version will be published to npm. This is harmless — prerelease versions don't affect the `latest` dist-tag. **Never manually promote a prerelease to `latest`** via `npm dist-tag`.
63
+
64
+
> [!CAUTION]
65
+
> After a rollback, the next `changeset version` bumps from the rollback version normally. For example, `3.0.6-ROLLBACK` + a `patch` changeset → `3.0.7`. Verify the release PR shows the expected version before merging.
- [ ] 4.8. Create a changeset via `pnpm exec changeset add` documenting the breaking change (IE 11 drop). CHANGELOG.md is now generated automatically — do not edit it manually.
271
271
272
272
- [ ] 4.9. Verify: `pnpm test` passes, `pnpm run build` produces correct output, `pnpm run type-check` passes
0 commit comments