This project uses Changesets to record release intent before the version and publish steps run.
Use the command that matches the repository's package manager:
- npm:
npx @changesets/cli - pnpm:
pnpx @changesets/cli
This project uses the Changesets tool to manage semantic versioning and release notes.
Permit GitHub Actions to create and approve pull requests:
- Go to Actions -> General in the repository settings: (
https://github.com/<user>/<repo>/settings/actions) - In
Workflow permissionsenable the toggle forAllow GitHub Actions to create and approve pull requests(it is not required to also toggle theRead and write permissionoption)
Run the Changesets CLI and follow the prompts:
# npm
npx @changesets/cli
# pnpm
pnpx @changesets/cliThe CLI asks which package changed, what semver bump is needed, and what summary should go in the changelog. Use:
patchfor backward-compatible fixes and small internal changesminorfor backward-compatible new functionalitymajorfor breaking changes
Then commit and push the generated changeset:
git add .changeset
git commit -m "chore: release"
git push origin HEAD --no-verifyThe Changesets CLI is mostly interactive when creating a normal changeset. If a TTY is not available, write the changeset file directly.
First, read the package name from package.json instead of hard-coding it:
PACKAGE_NAME=$(node -p "require('./package.json').name")Create a changeset file under .changeset/:
CHANGESET_FILE=".changeset/$(date +%s)-release.md"
cat > "$CHANGESET_FILE" <<EOF
---
"$PACKAGE_NAME": patch
---
Describe the change here.
EOFReplace patch with minor or major when the change requires a larger semver bump. Keep the summary short and user-facing; it is used by Changesets when generating release notes.
Commit and push the changeset:
git add .changeset
git commit -m "chore: release"
git push origin HEAD --no-verifyAfter the changeset lands on the release branch, run the configured package scripts when it is time to cut and publish the release:
# npm
npm run version
npm run release
# pnpm
pnpm run version
pnpm run release