This project uses Semantic Release to automate versioning, changelog generation, and GitHub releases based on conventional commit messages.
Semantic Release analyzes commit messages following the Conventional Commits specification to determine:
- The next version number (major, minor, or patch)
- Generate release notes and changelog
- Create Git tags and GitHub releases
- Update package.json versions
We use the existing commitlint configuration that enforces conventional commits:
feat: A new feature (triggers minor release)fix: A bug fix (triggers patch release)perf: Performance improvement (triggers patch release)refactor: Code refactoring (triggers patch release)build: Changes to build system or dependencieschore: Maintenance taskstest: Adding or updating testsdocs: Documentation changes
Any commit with BREAKING CHANGE: in the footer or ! after the type triggers a major release.
# Patch release (1.0.0 -> 1.0.1)
git commit -m "fix(aurora-portal): resolve authentication issue"
# Minor release (1.0.0 -> 1.1.0)
git commit -m "feat(gardener): add cluster creation wizard"
# Major release (1.0.0 -> 2.0.0)
git commit -m "feat(core)!: redesign authentication system
BREAKING CHANGE: The authentication API has been completely redesigned"Releases are triggered automatically when commits are pushed to the main branch.
You can trigger a release manually using GitHub Actions:
- Go to the "Actions" tab in GitHub
- Select "Semantic Release" workflow
- Click "Run workflow"
.releaserc.js: Main semantic-release configuration.github/workflows/semantic-release.yaml: GitHub Actions workflowcommitlint.config.mjs: Commit message validation (already exists)
Each release creates:
- Git Tag: Following semver (e.g.,
v1.2.3) - GitHub Release: With generated release notes
- Changelog: Updated
CHANGELOG.mdfile - Version Bumps: Updated
package.jsonfiles
The following secrets must be configured in GitHub repository settings:
GITHUB_TOKEN: Automatically provided by GitHub ActionsNPM_TOKEN: Required if publishing to npm registry (currently disabled)
Semantic Release runs after successful:
- Build (
pnpm build)
Test semantic release without creating actual releases:
pnpm release:dry- Check if commits follow conventional commit format
- Ensure commits contain releasable changes (feat, fix, perf, refactor)
- Verify all CI checks pass
- Ensure GitHub token has write permissions
- Check repository settings for branch protection rules
- Semantic release handles versioning automatically
- Don't manually edit version numbers in package.json
- Always use conventional commits - This is enforced by commitlint
- Use descriptive scopes - Reference the allowed scopes in
commitlint.config.mjs - Document breaking changes - Use
BREAKING CHANGE:footer for major releases - Keep commits atomic - One logical change per commit
- Use meaningful commit messages - They become part of the changelog
- Watch the "Semantic Release" workflow in GitHub Actions
- Check the generated
CHANGELOG.mdafter each release - Monitor GitHub releases page for published releases