preview merges into main, semantic-release analyzes commit messages, determines the version bump, updates CHANGELOG.md, creates a git tag, and publishes a GitHub Release — all without any manual steps.
How it works
Version bump rules
The version bump is determined by the highest-impact commit in the batch merged tomain:
| Commit prefix | Release? | Version bump | Example |
|---|---|---|---|
feat: | Yes | Minor (0.1.0 → 0.2.0) | feat: add sponsor tier badges |
fix: | Yes | Patch (0.1.0 → 0.1.1) | fix: correct hero image aspect ratio |
feat!: or BREAKING CHANGE: | Yes | Major (0.1.0 → 1.0.0) | feat!: rename block prop interface |
perf: | Yes | Patch | perf: lazy-load sponsor logos |
chore:, docs:, ci:, test:, refactor: | No | — | Not included in a release |
What happens on merge to main
Commit analysis
@semantic-release/commit-analyzer reads all commits since the last tag using the conventionalcommits preset. It determines whether a release is needed and what the version bump is.Release notes generated
@semantic-release/release-notes-generator builds the changelog body. Commits are grouped by type: Features, Bug Fixes, Performance, Documentation, CI/CD, Tests, Refactoring, Miscellaneous.CHANGELOG.md updated
@semantic-release/changelog prepends the new release notes to CHANGELOG.md. Do not edit this file manually — it is always overwritten.package.json version bumped
@semantic-release/npm updates the version field in the root package.json. npmPublish: false ensures the package is not published to the npm registry.Changelog committed
@semantic-release/git commits CHANGELOG.md and package.json back to main with the message:[skip ci] tag prevents an infinite loop of release workflows.GitHub Release created
@semantic-release/github creates a GitHub Release with the version tag (e.g., v1.2.3) and the generated release notes as the body.preview branch synced
The
sync-preview.yml workflow runs after the release workflow completes. It merges main into preview so the next feature branch is based on the released code..releaserc.json
The full configuration:branches: ["main"]— only releases frommain, never frompreviewor feature branchesnpmPublish: false— version bump only, no npm registry publishassets: ["CHANGELOG.md", "package.json"]— only these two files are committed back by the release- All 8 commit types appear in release notes (even
choreandtest) for full traceability, but onlyfeat,fix, andperftrigger a version bump
GitHub Actions workflow
The release runs in.github/workflows/release.yml:
fetch-depth: 0 is required. semantic-release reads the entire git history to find the previous release tag and analyze commits since then. Without the full history, it cannot determine the correct version bump.CHANGELOG format
The generatedCHANGELOG.md follows Keep a Changelog conventions with sections grouped by commit type. Example:
CHANGELOG.md manually. Every release overwrites it by prepending the new section at the top.