From bmad-skills
Sets up Google's release-please for automated versioning, changelog generation, and GitHub Actions publishing using Conventional Commits. Covers pipelines, monorepos, pre-releases, commit messages, and troubleshooting.
npx claudepluginhub bmad-labs/skills --plugin bmad-skillsThis skill uses the workspace's default tool permissions.
[release-please](https://github.com/googleapis/release-please) automates versioning and releases by analyzing Conventional Commit messages:
Suggests manual /compact at logical task boundaries in long Claude Code sessions and multi-phase tasks to avoid arbitrary auto-compaction losses.
Share bugs, ideas, or general feedback.
release-please automates versioning and releases by analyzing Conventional Commit messages:
release-please handles version determination, changelog generation, and git tagging. You write good commit messages; it does the rest.
When a user asks for help writing a commit message (not setting up a pipeline):
If the change is breaking, always include a BREAKING CHANGE: footer explaining migration impact.
When a user wants to set up release-please, follow this interactive protocol.
If .github/workflows/release.yml (or similar) already exists, read it first, compare against the templates in references/workflow-templates.md, and suggest specific improvements rather than replacing it wholesale. Common improvement opportunities: missing concurrency groups, publish not gated on release_created, missing idempotent publish check, overly broad permissions.
Scan the repository for package manifests:
| File | Release Type |
|---|---|
package.json | node |
pyproject.toml / setup.py | python |
pom.xml | java |
go.mod | go |
Cargo.toml | rust |
*.gemspec | ruby |
composer.json | php |
pubspec.yaml | dart |
mix.exs | elixir |
Chart.yaml | helm |
If multiple manifests exist at the root, ask which is primary. If none found, use simple.
Ask these questions (skip any already answered or obvious from context):
main)0.0.0)Create three files based on the answers:
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "node",
"changelog-path": "CHANGELOG.md",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": false,
"versioning": "default",
"extra-files": []
}
}
}
Adjust release-type based on detected project type. For monorepos, add multiple entries under packages with component names.
{
".": "1.0.0"
}
Set to the current released version. Use "0.0.0" for new projects.
For Node.js → npm public registry (most common), use this base template:
name: Release
on:
push:
branches: [main]
permissions:
contents: write
pull-requests: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}
steps:
- uses: googleapis/release-please-action@v4
id: release
publish:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
For other ecosystems, see references/workflow-templates.md for complete templates including:
Always customize:
main with the actual default branch if differentreferences/workflow-templates.md| Option | Default | Purpose |
|---|---|---|
release-type | — | Package ecosystem (required) |
bump-minor-pre-major | false | Treat feat as patch when < 1.0.0 |
changelog-path | CHANGELOG.md | Where to write the changelog |
include-v-in-tag | true | Tag as v1.2.3 vs 1.2.3 |
separate-pull-requests | false | One PR per package (monorepo) |
draft | false | Create release PRs as drafts |
extra-files | [] | Additional files with version strings to update |
changelog-sections | (defaults) | Customize which types appear in changelog |
// release-please-config.json
{
"packages": {
"packages/core": { "release-type": "node", "component": "core" },
"packages/cli": { "release-type": "node", "component": "cli" }
}
}
// .release-please-manifest.json
{ "packages/core": "0.0.0", "packages/cli": "0.0.0" }
Use component names as commit scopes: feat(core): add streaming support
For full configuration options, see references/config-options.md.
release-please reads commit messages to determine version bumps and generate changelogs. Every commit to the default branch must follow Conventional Commits.
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
| Type | Bump | Triggers Release? |
|---|---|---|
feat | Minor | Yes |
fix | Patch | Yes |
deps | Patch | Yes |
refactor | — | No |
perf | — | No |
test | — | No |
docs | — | No |
style | — | No |
chore | — | No |
build | — | No |
ci | — | No |
Breaking changes (any type with ! or BREAKING CHANGE: footer) → Major bump.
feat(api)!: redesign authentication flow
BREAKING CHANGE: /auth/login now requires OAuth2 tokens instead of API keys.
refactor(database): migrate from MongoDB to PostgreSQL
BREAKING CHANGE: all database connection strings must be updated.
| Footer | Purpose |
|---|---|
BREAKING CHANGE: <desc> | Triggers major version bump |
Release-As: x.x.x | Force a specific version number |
feat(booking): add search by date range endpoint
fix(auth): resolve token refresh race condition
deps: upgrade @nestjs/core to v11.0.0
test(scheduler): add unit tests for cron parser
chore: update .gitignore
NEVER add Co-Authored-By trailers for AI agents in commit messages. These pollute changelogs and git history.
For the complete commit conventions reference with 15+ examples, scopes guide, and anti-patterns, see references/commit-conventions.md.
Configure your repository to use squash merges for feature branches. This ensures each PR produces a single conventional commit, keeping the changelog clean. Set the squash commit message to use the PR title (which should be a conventional commit message).
The GitHub Action needs contents: write and pull-requests: write at minimum. Add packages: write or id-token: write for publish steps as needed. Use the principle of least privilege — grant permissions per-job, not at workflow level.
Always set cancel-in-progress: false for release workflows. Canceling a release mid-way can leave partial state (tags without releases, PRs in inconsistent state).
Never publish in the release-please job itself. Use a separate publish job gated on release_created == 'true'. This separates concerns and makes retries easier.
Check if the version already exists in the registry before publishing. This prevents failures on workflow re-runs:
- name: Check if version exists
id: check
run: |
PACKAGE_NAME=$(node -p "require('./package.json').name")
VERSION=$(node -p "require('./package.json').version")
if npm view "${PACKAGE_NAME}@${VERSION}" version 2>/dev/null; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- if: steps.check.outputs.exists == 'false'
run: npm publish
When adding release-please to a project with existing releases:
.release-please-manifest.json to your current versionchore: commitRelease-As: x.x.x footer to force a starting versionfeat, fix, deps)release-please-config.json and manifest exist and are valid JSONchore: won't trigger a release, feat: triggers minorBREAKING CHANGE: footers that may trigger an unexpected major bumpRelease-As: x.x.x footer to override if neededworkflow_dispatch, not automatic push triggers1.2.3-alpha.1next npm tag (or equivalent) for pre-releases, latest for stablereferences/workflow-templates.mdGITHUB_TOKEN works for release-please PRs and releasesNPM_TOKEN, etc.)GITHUB_TOKEN with packages: write permission| Reference | Description |
|---|---|
references/commit-conventions.md | Full Conventional Commits specification with examples and anti-patterns |
references/workflow-templates.md | Complete workflow templates for 9 ecosystems |
references/config-options.md | All configuration options, release types, and Action inputs/outputs |
| release-please GitHub | Official documentation |
| Conventional Commits | Specification |