-
Notifications
You must be signed in to change notification settings - Fork 121
feat: switch to changesets release PR workflow #951
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
Draft
kdaviduik
wants to merge
1
commit into
enable-auto-changelog
Choose a base branch
from
03-13-chore_delete_deploying.md
base: enable-auto-changelog
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| CONTRIBUTING.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| CONTRIBUTING.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,65 @@ | ||
| # How to contribute | ||
|
|
||
| We ❤️ pull requests. If you'd like to fix a bug, contribute a feature or | ||
| just correct a typo, please feel free to do so, as long as you follow | ||
| our [Code of Conduct](https://github.com/Shopify/js-buy-sdk/blob/main/CODE_OF_CONDUCT.md). | ||
|
|
||
| If you're thinking of adding a big new feature, consider opening an | ||
| issue first to discuss it to ensure it aligns to the direction of the | ||
| project (and potentially save yourself some time!). | ||
|
|
||
| ## Deploying and publishing | ||
|
|
||
| ### Publishing a new version | ||
|
|
||
| 1. Pull from main and install dependencies: | ||
| ``` | ||
| git pull origin main | ||
| pnpm install | ||
| ``` | ||
| 2. Create a changeset describing your changes: | ||
| ``` | ||
| pnpm exec changeset add | ||
| ``` | ||
| 3. Commit the changeset file alongside your code changes. **Do NOT manually update `CHANGELOG.md`** — it is generated automatically from changesets. | ||
| 4. Push and create a PR. **Do NOT bump the version in `package.json`** — changesets manages this. | ||
| 5. Merge the PR into `main`. The release workflow will automatically create a release PR titled `[ci] release`. | ||
| 6. Review the release PR — verify the version bump and `CHANGELOG.md` are correct. | ||
| 7. Merge the release PR. The release workflow will automatically publish the new version to npm and create a GitHub release. | ||
| 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. | ||
|
|
||
| ### Non-release changes | ||
|
|
||
| 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) | ||
|
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. 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 |
||
|
|
||
| Follow these steps to roll back the `latest` CDN version without publishing a normal npm release. | ||
|
|
||
| 1. Create a branch from `main` and revert the faulty code changes | ||
| 2. Do **not** include a changeset file. Verify no stale `.changeset/*.md` files exist (other than `README.md`): | ||
| ``` | ||
| ls .changeset/*.md | ||
| ``` | ||
| If any exist, delete them — stale changesets would cause the release workflow to open a release PR instead of a clean rollback. | ||
| 3. Append `-ROLLBACK` to the version in `package.json` (e.g., `3.0.6` → `3.0.6-ROLLBACK`) | ||
| 4. Run `pnpm install` to update the lockfile | ||
| 5. Stage and commit your changes | ||
| 6. Create a tag matching the new version: | ||
| ``` | ||
| git tag 3.0.6-ROLLBACK | ||
| ``` | ||
| 7. Push the branch and tags: | ||
| ``` | ||
| git push && git push --tags | ||
| ``` | ||
| 8. Create and merge the PR | ||
| 9. Deploy via [Shipit](https://shipit.shopify.io/shopify/buy-button-js/production) | ||
| 10. Purge the CDN cache via [Infra Central](https://infra-central.shopify.io/edge/purges): | ||
| - Press "New Purge" → choose "Url" → paste `https://sdks.shopifycdn.com/buy-button/latest/buybutton.js` → press "Create purge" | ||
|
|
||
| > [!CAUTION] | ||
| > 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`. | ||
|
|
||
| > [!CAUTION] | ||
| > 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. | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Overall this is very similar to Hydrogen's release.yml workflow