Opinionated
semantic-releaseshareable configuration for npm + GitHub publishing with changelog generation and release commits.
Website: https://oleg-koval.github.io/semantic-release-npm-github-publish/
This package is useful if you want one maintained preset instead of repeating the same semantic-release plugin composition in every repository.
It adds value beyond native plugin composition by shipping:
- extra patch release rules for
build,ci,chore,docs,refactor,style, andtest - curated changelog grouping, titles, and emojis via
commit-transform.jsandtypes.js - a fixed publish chain for npm + GitHub, including changelog updates and a release commit
The exported config uses this exact plugin chain:
@semantic-release/commit-analyzerwith customreleaseRulesfor additional patch-triggering commit types@semantic-release/release-notes-generator@semantic-release/changelog@semantic-release/npm@semantic-release/gitcommitspackage.json,package-lock.json, andCHANGELOG.mdwithrelease(version): Release ${nextRelease.version} [skip ci]@semantic-release/github
Release semantics match standard Conventional Commits and SemVer:
fix=> patchfeat=> minorBREAKING CHANGEfooter or!=> majorbuild,ci,chore,docs,refactor,style, andtest=> patch in this preset
This preset is actively maintained against the current stable semantic-release major.
- tested with Node
22and24 - publish workflow runs on Node
24 - peer dependency ranges are pinned to the currently supported plugin majors
- this repository also validates a
betaprerelease branch with a repo-only release config
Install semantic-release, this preset, and the peer plugins it expects:
npm install --save-dev \
semantic-release \
semantic-release-npm-github-publish \
@semantic-release/changelog \
@semantic-release/commit-analyzer \
@semantic-release/git \
@semantic-release/github \
@semantic-release/npm \
@semantic-release/release-notes-generatorAdd a release script:
{
"scripts": {
"semantic-release": "semantic-release"
}
}Run npx semantic-release in your release workflow.
For this repository itself, stable releases come from main and prereleases come from beta via release.repo.config.js. The exported shareable config remains branch-agnostic for consumers.
Migration notice: this preset does not hardcode consumer release branches. `main` is the documented default, but if your repository still releases from `master` or another branch, set `branches` explicitly in your repo-local semantic-release config.
Example .releaserc.yaml:
branches:
- main
extends: "semantic-release-npm-github-publish"
ci: false
dryRun: false
debug: falseIf your repository releases from a different branch, set branches explicitly in your repo-local config.
Example migration from master:
branches:
- master
extends: "semantic-release-npm-github-publish"
ci: false
dryRun: false
debug: falseUse this package when you want:
- the exact plugin chain documented above
- extra patch releases for maintenance-only commit types
- the opinionated changelog formatting in this repository
- a maintained upgrade path for this preset over time
Use repo-local plugin composition instead when your team wants different plugins, different release rules, or full control over upgrade timing.
- Consumer-facing examples now use
main. - Repository automation publishes stable releases from
mainand prereleases frombeta. - The repository default branch is
main, and all badges and examples now follow that. - The shared preset does not hardcode release branches for consumers; set
branchesin your repo-local config when you do not release frommain. - Dependabot PRs can auto-refresh
package-lock.jsonthrough the dedicated lockfile-fixer workflow. - Dependabot npm patch updates can enable GitHub auto-merge after required checks pass.
- The old README wording that inverted
fixandfeatwas documentation drift. The actual release behavior has been corrected and is now covered by tests.
Issues and pull requests are welcome.