🔧 **Improved Changelog Integration:** - Changelog is now appended to the PR merge commit message instead of creating a separate commit - Version bump changes are included in the same amended merge commit - Uses git commit --amend to modify the merge commit with both changelog and version changes - Updated force push with --force-with-lease for safer history rewriting - Cleaner git history with single commit containing all release information **Benefits:** - ✅ Single commit per release (cleaner history) - ✅ Changelog directly visible in merge commit - ✅ No additional 'chore: bump version' commits - ✅ All release info consolidated in one place - ✅ Safer force push with --force-with-lease
4.0 KiB
Version Management Workflow
This repository uses automated version management with GitHub Actions. Version bumps are triggered based on which branch changes are merged to main.
Available Branches
version/major- For breaking changes (e.g., 1.0.0 → 2.0.0)version/minor- For new features (e.g., 1.0.0 → 1.1.0)version/patch- For bug fixes (e.g., 1.0.0 → 1.0.1)
How to Use
For Patch Releases (Bug Fixes)
-
Create a branch from
version/patch:git checkout version/patch git pull origin version/patch git checkout -b fix/your-bug-fix # Make your changes git commit -m "fix: your bug fix description" git push origin fix/your-bug-fix -
Create a PR targeting
version/patch -
Once approved, merge the PR to
version/patch -
Create a PR from
version/patchtomain -
When merged to
main, the workflow will:- Bump patch version (e.g., 1.0.0 → 1.0.1)
- Run tests and build
- Publish to NPM
- Create a GitHub release
For Minor Releases (New Features)
-
Create a branch from
version/minor:git checkout version/minor git pull origin version/minor git checkout -b feature/your-feature # Make your changes git commit -m "feat: your feature description" git push origin feature/your-feature -
Create a PR targeting
version/minor -
Once approved, merge the PR to
version/minor -
Create a PR from
version/minortomain -
When merged to
main, the workflow will:- Bump minor version (e.g., 1.0.0 → 1.1.0)
- Run tests and build
- Publish to NPM
- Create a GitHub release
For Major Releases (Breaking Changes)
-
Create a branch from
version/major:git checkout version/major git pull origin version/major git checkout -b breaking/your-breaking-change # Make your changes git commit -m "feat!: your breaking change description" git push origin breaking/your-breaking-change -
Create a PR targeting
version/major -
Once approved, merge the PR to
version/major -
Create a PR from
version/majortomain -
When merged to
main, the workflow will:- Bump major version (e.g., 1.0.0 → 2.0.0)
- Run tests and build
- Publish to NPM
- Create a GitHub release
Direct Push to Main
Direct pushes to main will trigger a patch version bump by default.
Required Secrets
Make sure these secrets are configured in your GitHub repository:
NPM_TOKEN- Your NPM authentication token for publishingGITHUB_TOKEN- Automatically provided by GitHub Actions
Workflow Features
- ✅ Automatic version bumping based on branch
- ✅ AI-generated changelog using Claude Code CLI
- ✅ Appends changelog to PR merge commit message
- ✅ Runs tests before publishing
- ✅ Builds the package before publishing
- ✅ Creates git tags with changelog in tag message
- ✅ Publishes to NPM with public access
- ✅ Creates GitHub releases with formatted changelog
- ✅ Prevents publishing if tests fail
Changelog Generation
The workflow automatically generates a standardized changelog for each release using Claude Code CLI. The changelog analyzes git commits since the last release and categorizes them into:
- 🚀 Features - New functionality
- 🐛 Bug Fixes - Bug fixes and corrections
- 🔧 Improvements - Code improvements and refactoring
- 📚 Documentation - Documentation updates
- ⚡ Performance - Performance optimizations
The generated changelog is included in:
- The PR merge commit message (automatically appended)
- The git tag message
- The GitHub release notes
Version Branch Maintenance
Keep version branches up to date by periodically merging from main:
git checkout version/patch
git merge main
git push origin version/patch
git checkout version/minor
git merge main
git push origin version/minor
git checkout version/major
git merge main
git push origin version/major
This ensures that all version branches have the latest changes from main before creating new features or fixes.