This document explains how the automated release process works in this project.
We use semantic-release to automate our release process. This tool:
- Determines the next version number based on commit messages
- Generates release notes
- Creates a GitHub release
- Updates the CHANGELOG.md file
- Creates a Git tag
The release process is triggered automatically when changes are pushed to the main branch.
Our project follows the Git Flow workflow as described in the CONTRIBUTING.md file. Here's how the automated release process fits into Git Flow:
- Development happens on feature branches (
feature/*) branched fromdevelop - When features are complete, they are merged into
develop - When ready for a release, a release branch (
release/*) is created fromdevelop - The release branch is merged into
main(and back intodevelop) - When changes are pushed to
main, the automated release process is triggered - semantic-release analyzes the commits, determines the version, and creates a release
To ensure that semantic-release can determine the correct version number, commit messages should follow the Conventional Commits format:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
The commit type determines how the version number is incremented:
feat: A new feature (minor version bump)fix: A bug fix (patch version bump)docs: Documentation changes (patch version bump)style: Changes that don't affect the code's meaning (patch version bump)refactor: Code changes that neither fix a bug nor add a feature (patch version bump)perf: Performance improvements (patch version bump)test: Adding or correcting tests (patch version bump)build: Changes to the build system (patch version bump)ci: Changes to CI configuration (patch version bump)chore: Other changes that don't modify src or test files (patch version bump)
To indicate a breaking change (which will trigger a major version bump), add BREAKING CHANGE: in the commit message body or add a ! after the type:
feat!: add new authentication system
BREAKING CHANGE: `auth()` now returns a Promise instead of a boolean
Here are some example commit messages:
feat: add user profile page
fix: resolve issue with login form validation
docs: update installation instructions
feat(auth): implement two-factor authentication
feat!: redesign API endpoints
In some cases, you may need to create a release manually. To do this, follow the Git Flow release process as described in the CONTRIBUTING.md file:
# Start a release
git flow release start 1.2.3
# Finish a release (merges to both main and develop)
git flow release finish 1.2.3
# Push changes
git checkout main
git push origin main
git push origin --tags
git checkout develop
git push origin developThe automated release process will still be triggered when changes are pushed to main, but it will respect the version number in the tag if one exists.