semantic-release
БесплатноБез исполняемых скриптовНе проверенAutomates versioning and publishing: reads commit messages, picks the next semantic version, writes release notes and a changelog, tags the commit, publishes…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
semantic-release
Overview
semantic-release runs in CI after every push to a release branch. It reads the commits since the last tag, decides the bump (major, minor, patch or none), generates release notes, tags the commit, publishes the package and creates the GitHub release. Version 25 requires Node ^22.14.0 || >=24.10.0 for the process that runs it; the code you publish can target any Node. The default branches are main, master, next, next-major, beta, alpha and maintenance branches like 1.x.
Instructions
Step 1: Install
@semantic-release/commit-analyzer, release-notes-generator, npm and github are bundled with semantic-release and are the default plugins. Install only what you add:
npm install -D semantic-release @semantic-release/changelog @semantic-release/git
Step 2: Configure
Plugin order matters: changelog must come before npm and git, and git after npm, so the release commit contains the new files.
{
"branches": ["main", { "name": "beta", "prerelease": true }],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", { "changelogFile": "CHANGELOG.md" }],
"@semantic-release/npm",
["@semantic-release/git", { "assets": ["CHANGELOG.md", "package.json"] }],
"@semantic-release/github"
]
}
Save as .releaserc.json. Keep "version": "0.0.0-development" in package.json; the plugin writes the real version during the release. The git plugin commits as chore(release): 1.4.0 [skip ci] and pushes it.
Step 3: Run it in CI
Trusted publishing (OIDC) needs no NPM_TOKEN: on npmjs.com add your repository and the workflow file name as a Trusted Publisher for the package, then give the job id-token: write. Provenance is attached automatically.
# .github/workflows/release.yml
name: Release
on:
push:
branches: [main]
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # tags, release commit, GitHub release
issues: write # comments on released issues
pull-requests: write
id-token: write # npm trusted publishing + provenance
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm ci
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Do not set registry-url in setup-node: the .npmrc it writes conflicts with semantic-release's npm auth (EINVALIDNPMTOKEN). If you still publish with a classic token, add NPM_TOKEN: ${{ secrets.NPM_TOKEN }} to env. Pin the actions to the versions you use today.
Step 4: Commit format
The default is the Angular convention:
| Commit | Release |
|---|---|
fix(parser): handle empty input |
patch |
perf(cache): avoid double read |
patch |
feat(cli): add --json flag |
minor |
any type with a BREAKING CHANGE: ... footer |
major |
docs:, chore:, refactor: |
none |
Enforce the format with commitlint and a commit-msg hook (husky or lefthook).
Step 5: Preview locally
npx semantic-release --dry-run --no-ci
It prints the next version and notes without tagging or publishing. Locally it needs a pushed branch and the same plugins installed; --no-ci skips the CI-environment check.
Examples
Example 1: Ship the first 1.0.0 from a new library
Request: "Set up automatic npm releases for @northwind/date-utils."
After installing and adding the files above, merge feat: add parseISODuration to main. The run logs The release type for the commit is minor, the next release version is 1.0.0, creates tag v1.0.0, publishes, and pushes chore(release): 1.0.0 [skip ci] with CHANGELOG.md updated. The first release is always 1.0.0; to start from an older line, tag the last commit v0.9.0 first.
Example 2: Beta channel for a risky change
Request: "Publish pre-releases from the next-gen branch."
Add { "name": "next-gen", "prerelease": "beta", "channel": "beta" } to branches (without channel the dist-tag is the branch name, next-gen). Pushing a commit with a BREAKING CHANGE: footer there, when 1.x is the stable line, publishes 2.0.0-beta.1 under the beta dist-tag, so npm install pkg still gets the stable version; npm install pkg@beta gets the pre-release.
Guidelines
fetch-depth: 0is mandatory: a shallow clone has no tags and semantic-release will think nothing was ever released.- The built-in
GITHUB_TOKENcannot push the release commit to a protected branch; either skip@semantic-release/git(keep the version out ofpackage.json, which is the recommended approach) or use a deploy key or app token. - Releases cannot be undone: a published npm version is permanent. Use
--dry-runbefore changing
Установить semantic-release в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл semantic-release?
Automates versioning and publishing: reads commit messages, picks the next semantic version, writes release notes and a changelog, tags the commit, publishes to npm and creates the GitHub release. Use when a user asks to automate npm publishing, set up semantic-release in GitHub Actions, generate a CHANGELOG, or stop bumping versions by hand.
Как установить скилл semantic-release?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл semantic-release запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic