Changesets
We configure our repositories to release changes with Changesets.
-
Install the CLI (and the GitHub changelog generator, if you want changelog entries to link to PRs and authors):
yarn add --dev @changesets/cli @changesets/changelog-github -
Scaffold
.changeset/:yarn changeset init -
Edit
.changeset/config.json— setbaseBranchto your default branch,accesstorestricted(GitHub Packages) orpublic, and pointchangelogat["@changesets/changelog-github", { "repo": "<owner>/<repo>" }]if you installed the generator. -
Add the helper scripts to
package.json:{"scripts": {"changeset": "changeset","version": "changeset version","release": "changeset publish"}} -
Add a release workflow that runs on pushes to the default branch and drives changesets/action with
version: yarn run changeset versionandpublish: yarn run changeset publish. It needscontents: write(version commits, tags, GitHub releases),pull-requests: write(the "Version Packages" PR) andpackages: write(publishing). Configure npm to usehttps://npm.pkg.github.comand passGITHUB_TOKENas bothGITHUB_TOKENandNODE_AUTH_TOKEN— no extra secrets are required.
Once configured, see the releasing with Changesets runbook for the day-to-day process.