semantic-release Config Builder

Generate a .releaserc.json for automated semantic versioning and publishing

Builds a semantic-release configuration with release branches, tag format, and an ordered plugin chain — commit-analyzer, release-notes-generator, changelog, npm, github, and git — for fully automated versioning and publishing.

Why does plugin order matter?

semantic-release runs plugins in array order through lifecycle steps. commit-analyzer must run first to determine the version, release-notes-generator next, and the git plugin must come last so it commits the already-updated package.json and changelog.

Automate releases with semantic-release

semantic-release removes manual version bumps entirely. It reads your commit history, figures out the right semantic version, generates release notes, publishes to npm, creates a GitHub release, and commits the changelog back — all from CI. The behavior is driven by .releaserc.json, and this builder produces a correct, ordered configuration.

How it works

The branches array lists which branches are allowed to trigger a release, typically main for stable plus channels like next for pre-releases. tagFormat controls the git tag, defaulting to v${version}.

The plugins array is an ordered pipeline, and order is the most important detail. commit-analyzer runs first to compute the next version from Conventional Commit messages — fix means patch, feat means minor, BREAKING CHANGE means major. release-notes-generator then renders notes. Optional plugins follow: changelog writes CHANGELOG.md, npm publishes the package, and github creates the release. The git plugin must come last so it commits the updated package.json and changelog back with a [skip ci] message to avoid an infinite loop.

Tips and notes

  • Keep git as the final plugin in the array, always.
  • Supply NPM_TOKEN and GITHUB_TOKEN as CI secrets — never in the config.
  • Disable the npm plugin for apps that release but should not publish a package.
  • Pair this with a commitlint config so every commit is parseable.