This document describes how to release new versions of wm2.
We use changesets for automated releases. This ensures consistent versioning and changelog generation.
-
Make your changes and commit them to a feature branch
-
Create a changeset to describe your changes:
npm run changeset
- Select the type of change (major, minor, patch)
- Write a summary of your changes (this will appear in the changelog)
-
Commit the changeset along with your changes:
git add .changeset/ git commit -m "Add changeset" -
Push your branch and create a pull request
-
Merge to main - Once your PR is merged, the release workflow will:
- Create or update a "Version Packages" PR
- This PR will accumulate all changesets since the last release
- When you're ready to release, merge this PR
-
Automatic publish - After merging the Version Packages PR:
- Package version is updated
- CHANGELOG.md is generated/updated
- Git tag is created
- Package is published to npm
- GitHub release is created
The automated release process is handled by .github/workflows/release.yml:
- Runs on every push to main
- Uses changesets to manage versions
- Publishes to npm with provenance
- Creates GitHub releases automatically
For the automated release to work, you need to:
- Generate an npm token with publish permissions
- Add it as
NPM_TOKENin your GitHub repository secrets
If you need to do a manual release for any reason:
# Manual release with the old script
./mise/release.sh --manual [major|minor|patch]This will:
- Run tests
- Build the package
- Update version numbers
- Create git tag
- Push to GitHub
- Optionally publish to npm
- Use changesets for all releases - This ensures consistent changelog and version management
- Write clear changeset summaries - These become your changelog entries
- Batch related changes - Multiple changesets can be included in one release
- Test before releasing - The CI will run tests, but always verify locally first
- Semantic versioning:
patch: Bug fixes and minor updatesminor: New features (backwards compatible)major: Breaking changes
- Check that changesets were added (
.changeset/*.mdfiles) - Verify GitHub Actions are enabled
- Check workflow permissions in repository settings
- Verify NPM_TOKEN is set in GitHub secrets
- Check npm account has publish permissions
- Ensure package name is available
- Use
./mise/release.sh --manualas a fallback - Consider why automation failed and fix for next time