Releasing
April 9, 2024 Β· View on GitHub
πΈ Snapshot releases
Snapshot releases are a way to test your changes in a consuming project without publishing a new version. You can create a snapshot from your pull request if:
- CI is passing on your feature branch
- Your feature branch has at least one pending changeset
π¦ Polaris npm packages
- Add a comment with the
/snapitslash command in your feature branch PR - The github-actions bot will react to your comment with π once the
snapit.ymlworkflow is running, then react with a π and post a comment listing install commands for the snapshots of each npm package that will be included in the next version release
π©βπ» polaris-for-vscode
The polaris-for-vscode extension is published to the Visual Studio Marketplace. The extension is automatically released using the release-vscode.yml workflow.
Version releases
Polaris uses Changesets to handle releasing new versions of the packages in the Shopify/polaris repository.
We have a GitHub action that:
- Creates a
changeset-release/mainbranch and opens a PR titled "Version Packages" that always has an up-to-date run ofchangeset version - Keeps the
changeset-release/mainbranch up to date whenever a pull request is merged tomain - Performs a release when the
changeset-release/mainbranch merged into themainbranch - Recreates the
changeset-release/mainbranch after the release is complete and opens a new "Version Packages" PR
Prerelease (beta)
Similar to the normal Changeset release workflow described above, a prerelease PR is created when merging work with changesets into the next branch. The "Version Packages (beta)" PR will contain all changes that will be included in the next major release.
When merging this PR into next, a new prerelease is created with the beta dist tag. You can learn more about prerelease support using Changesets here.
Steps for creating a new prerelease branch if next doesn't currently exist.
- Create a new
nextbranch for prerelease development - Run
pnpm changeset pre enter beta - Adjust the release workflow file (
.github/workflows/release.yml) to run on thenextbranch:on: push: branches: - main - next - Branch future work from the
nextbranch - Create changesets, merge to the prerelease branch (
next) - Releasing PRs should now be generated for the prerelease branch π
Who can perform a version release?
Anyone at Shopify can perfom a version release. Ping the @Shopify/polaris-team on GitHub or the @polaris-developers team in the #polaris Slack channel for support.
Steps to perform a version release:
1. π§ͺ Test the "Version Packages" PR
- Create a snapshot release of the "Version Packages" PR
- Create a new branch in a
Shopify/webSpinstance that upgrades@shopify/polaristo its snapshot release
2. π’ Publish the release
- Once CI passes in the
Shopify/webupgrade branch, approve and merge the "Version Packages" PR - Merging the "Version Packages" PR triggers the
release.ymlworkflow that publishes the packages
3. πΈοΈ Upgrade @shopify/polaris in Shopify/web
- Draft a PR for the
Shopify/webupgrade branch with:- Version Packages PR link
- Tl;dr of the key things to tophat
- Spinstance URL
- "Key dependencies" and "Polaris" labels
- Contributors listed in the Version Packages PR description tagged as reviewers
- Once the release is available on npm, install the new version of
@shopify/polarisin theShopify/webupgrade PR - Send a link to the
Shopify/webupgrade PR in a group Slack DM to the contributors requesting they tophat their changes in the Spinstance and flag regressions or approve the PR
4. π Upgrade @shopify/polaris in Shopify/shopify-frontend-template-react
5. π¦ Unicorn the release contributors
6. π£ Announce the new @shopify/polaris version and share the π¦ Unicorn in the #polaris Slack channel and in the Polaris Updates and Engineering groups in Workplace π
π Style guide deploys
The style guide is automatically deployed to polaris.shopify.com when new changes in the /polaris.shopify.com directory are merged into the main branch.