@theholocron/semantic-release-config
v7.3.0
Published
A semantic-release configuration for automated versioning and publishing.
Downloads
2,078
Maintainers
Readme
Semantic Release Config
A semantic-release configuration for automated versioning and changelog generation.
Installation
pnpm add -D @theholocron/semantic-release-config semantic-release \
@semantic-release/changelog @semantic-release/commit-analyzer \
@semantic-release/git @semantic-release/github \
@semantic-release/release-notes-generator \
conventional-changelog-conventionalcommitsIf your repo uses @semantic-release/exec for version bumping and publishing, add it too:
pnpm add -D @semantic-release/execUsage
Create a release.config.js at your repo root:
import { defineConfig } from "@theholocron/semantic-release-config";
export default defineConfig({
branches: ["main", { name: "alpha", prerelease: true }],
exec: {
prepareCmd: "pnpm exec holocron npm bump-versions ${nextRelease.version}",
publishCmd:
"pnpm -r --filter='./packages/*' publish --access public --no-git-checks --tag ${nextRelease.channel || 'latest'}",
},
});Omit exec for repos with a single package (semantic-release handles the version bump and publish natively):
import { defineConfig } from "@theholocron/semantic-release-config";
export default defineConfig();Options
| Option | Type | Default | Description |
| ---------- | ------------------------------ | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| branches | Array | ['main'] | Release branches. See semantic-release docs. |
| exec | { prepareCmd?, publishCmd? } | undefined | Commands for @semantic-release/exec. Omit if not needed. |
| assets | string[] | ['CHANGELOG.md', 'package.json', 'packages/*/package.json'] | Files committed by @semantic-release/git after release. |
Plugin pipeline
The config wires up this fixed plugin order:
@semantic-release/commit-analyzer— conventional commits withfeat→ minor,fix/perf/refactor→ patch,chore(deps)→ patch@semantic-release/release-notes-generator— conventional changelog sections@semantic-release/changelog— writesCHANGELOG.md@semantic-release/exec— repo-specific version bump and publish commands (only whenexecis passed)@semantic-release/git— commits updated files back to the repo@semantic-release/github— creates a GitHub release
Named exports
For advanced composition, individual plugin configs are also exported:
import {
commitAnalyzer,
releaseNotesGenerator,
} from "@theholocron/semantic-release-config";