Automated Releases
Overview
Use this skill to add or maintain semantic-release workflows that automate changelogs, tags, version bumps, and GitHub releases.
Prefer a file-based semantic-release config, a release workflow on main, and a changelog-first setup that does not assume package registry publishing is required.
Workflow
Inspect the repo release surface. Read
package.json, check whether.releaserc.jsalready exists, and inspect any existing.github/workflows/release.yml.Add or align semantic-release dependencies. Add a
semantic-releasescript inpackage.json. Pin the semantic-release packages to the exact stable versions used by this setup. The pinned set includes@semantic-release/npm, which this setup needs for the version bump even though it never publishes. Use npmoverridesto pinlodash-esto4.17.21.Add file-based release config. Prefer
.releaserc.jsover inlinepackage.jsonconfig. Configuremainas the release branch. Enable commit analysis, release notes generation, changelog updates, the version bump, release commits, and GitHub releases. Include@semantic-release/npmwithnpmPublish: false, ordered before@semantic-release/git. Do not publish to npm or GitHub Packages in this skill.Keep the npm plugin even though nothing is published. It does two separate jobs: its prepare step writes the new version into
package.json, and only its publish step talks to the registry. SettingnpmPublish: falseswitches off the publish half and keeps the bump. Drop the plugin andpackage.jsonkeeps its old version forever — and because@semantic-release/gitstages an asset only when the file actually changed on disk, listingpackage.jsonin itsassetssilently does nothing.Add the GitHub Actions workflow. Trigger on pushes to
main. Useactions/checkoutwithfetch-depth: 0. Do not configure npm caching inactions/setup-node. Install dependencies. Runnpm run semantic-release. Grant the workflow enough permissions for changelog commits, tags, and GitHub releases.Check release prerequisites. Ensure commit messages follow Conventional Commits. Only
feat,fix, and breaking changes produce a release under the default preset.chore,docs,style,refactor, andtestdo not, so a batch of those lands onmainand correctly produces no release at all. If the package or project already has releases outside semantic-release, seed git with the current version tag before enabling automation. Setpackage.jsonto match that seeded tag by hand. The version bump only writes releases made from now on; it never backfills the version you already shipped.Troubleshoot failures by category. If semantic-release starts at
1.0.0unexpectedly, add the existing version tag to git. If a release succeeds butpackage.jsonkeeps its old version,@semantic-release/npmis missing fromplugins. The give-away is a release commit that touchesCHANGELOG.mdand nothing else. If no release happens at all, read the commit types since the last tag before suspecting the pipeline. If changelog commits fail, inspect branch protection and workflow token permissions. If semantic-release crashes during verify, inspect resolved dependency versions and confirm thelodash-esoverride is active.
References
Read references/semantic-release-changelog.md for the recommended semantic-release config and workflow shape.