Ruletypescript
Release Rule
1. **Create a staging branch** from the `main` branch: ```bash git checkout main git pull origin main git checkout -b v1.x.x-staging # e.g., v1.4.14-staging ```
Release Process
Stable Release (to main branch)
-
Create a staging branch from the
mainbranch:git checkout main git pull origin main git checkout -b v1.x.x-staging # e.g., v1.4.14-staging -
Cherry-pick commits from
canarybranch:git cherry-pick <commit-hash> # Repeat for each commit you want to include -
Open a Pull Request targeting the
mainbranch -
Wait for CI to pass (all checks must be green)
-
Rebase and merge the PR to
mainbranch -
Bump version and create tag:
git checkout main git pull origin main pnpm bump # Interactive prompt to select version, creates commit & tag, automatically pushes -
The release workflow (
.github/workflows/release.yml) will automatically:- Generate changelog using
changelogithub - Build all packages
- Publish to npm with the
latesttag
- Generate changelog using
Beta Release (on canary branch)
Beta versions are released from the canary branch:
git checkout canary
pnpm bump # Select a beta version (e.g., v1.4.15-beta.0)
git push origin canary --follow-tags
The release workflow will publish to npm with the beta tag.
Version Branch Releases
For maintaining older versions (e.g., v1.3.x while v1.4.x is latest):
- Create a version branch named
v1.3.x-latest - Tags pushed from this branch will also receive the
latestnpm tag
Notes
- Do not merge breaking changes to
mainbranch unless upgrading minor versions (e.g., 1.4 to 1.5) - Merge conflicts: Resolve them carefully. Review each conflict to ensure no code is accidentally removed or duplicated
- Keep the release branch clean: Do not create extra commits on the releasing branch. If you need to fix CI issues, squash the fix into the appropriate existing commit
- All releases are triggered by pushing tags matching
v* - The CI determines the npm tag based on:
- Pre-release suffix in tag name (canary, beta, rc, next)
- Whether the commit is on
mainor a version branch (v*.*.x-latest)
- Always ensure CI is green before creating release tags