AGENT SKILL

release-please 配置管理

release-please-configuration

release-please 的 monorepo 配置——组件标签、各软件包的 extra-files、标签迁移。用于添加软件包,或修复重复标签(duplicate-tag)/无版本递增(no-bump)失败问题。

适用职业发布经理
License 许可
MIT
最近更新
2026-11-15
Stars
★ 60
Forks
6

01 前言 Front Matter

name
release-please-configuration
created
1766880000000
modified
1794441600000
reviewed
1783123200000
description
release-please monorepo config — component tags, per-package extra-files, tag migration. Use when adding packages or fixing duplicate-tag / no-bump failures.
allowed-tools
Read, Write, Edit, Bash, Grep, Glob, TodoWrite
user-invocable
false

02 资源文件 6

03 SKILL.md 正文

Release-Please Monorepo Configuration

Monorepo-specific release-please strategy: component tagging, per-package extra-files, linked versions, and the shared→component tag migration. For the single-repo workflow/manifest/config shape, the conventional-commit version-bump rules, and compliance auditing, use configure-plugin:configure-release-please.

When to Use This Skill

Use this skill when... Use the alternative when...
Configuring component/include-component-in-tag for a multi-package repo Setting up a single-repo release-please (workflow, manifest, config shape) — use configure-plugin:configure-release-please
Adding a new package to a monorepo's release-please config Auditing an existing setup against documented conventions — use configure-plugin:configure-release-please
Fixing duplicate-tag, multiple-paths, or per-package no-bump failures Actually merging release-please PRs — use release-please-pr-workflow
Migrating from shared v1.0.0 tags to component-v1.0.0 tags Detecting manual edits to managed files — use release-please-protection
Setting per-package extra-files (JSON/YAML/TOML/XML version locations) Release-As: trailer-based one-off overrides — use git-commit-trailers

Core Files

File Purpose
release-please-config.json Per-package config, changelog sections, extra-files
.release-please-manifest.json Current version for each package/component
.github/workflows/release-please.yml GitHub Actions workflow (see configure-plugin:configure-release-please REFERENCE.md for the shape)

Monorepo Configuration

Critical Settings for Monorepos

{
  "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
  "include-component-in-tag": true,
  "separate-pull-requests": true,
  "packages": {
    "package-a": {
      "component": "package-a",
      "release-type": "simple",
      "extra-files": ["package-a/version.json"]
    }
  }
}

Key Fields:

Field Required Purpose
include-component-in-tag Yes (monorepo) Creates package-a-v1.0.0 tags instead of v1.0.0
component Yes (monorepo) Unique identifier for each package; must be set for every package
separate-pull-requests Recommended Creates per-package release PRs instead of combined

Linked Versions

To keep a set of components on the same version, use the linked-versions plugin:

{
  "packages": {
    "packages/frontend": {"release-type": "node", "component": "frontend"},
    "packages/backend": {"release-type": "node", "component": "backend"}
  },
  "plugins": [
    "node-workspace",
    {
      "type": "linked-versions",
      "groupName": "workspace",
      "components": ["frontend", "backend"]
    }
  ]
}

Common Failure: Duplicate Release Tags

Symptom: Workflow fails with Duplicate release tag: v2.0.0

Cause: All packages try to create the same tag (e.g., v2.0.0) because:

  1. Missing include-component-in-tag: true at root level
  2. Missing component field in each package

Fix:

{
  "include-component-in-tag": true,
  "packages": {
    "my-package": {
      "component": "my-package",  // Add this to every package
      ...
    }
  }
}

Common Failure: Multiple Paths Warning

Symptom: Multiple paths for : package-a, package-b

Cause: Empty component field (the : with nothing after it indicates empty string)

Fix: Ensure every package has "component": "package-name" set

Common Failure: Merged Release PR Never Tagged

Symptom: Every run after a grouped release PR merges aborts with:

There are untagged, merged release PRs outstanding - aborting

The workflow log also carries the tell:

pullRequestTitlePattern miss the part of '${component}'
pullRequestTitlePattern miss the part of '${scope}'

Cause: A custom pull-request-title-pattern (or group-pull-request-title-pattern) containing ${version} — or ${component} / ${scope} — on a grouped release PR (separate-pull-requests: false). Because a grouped PR spans many packages, there is no single version/component to substitute, so the pattern renders a bare title (e.g. chore: release with nothing after it). On the tagging pass release-please re-parses the merged PR's title back through that same pattern to recover which releases it represents; the bare title no longer matches the pattern, so the PR is never tagged. It stays autorelease: pending, and every subsequent run refuses to proceed while an untagged merged release PR is outstanding.

Fix: Drop the custom title patterns. The release-please defaults round-trip correctly for grouped PRs — they render a parseable title and the tagging pass recovers the releases from it.

// WRONG - ${version} on a grouped PR renders a bare, unparseable title
{
  "separate-pull-requests": false,
  "pull-request-title-pattern": "chore: release ${version}"
}

// CORRECT - omit the custom pattern; the default round-trips
{
  "separate-pull-requests": false
}

A PR that already merged with a bare title stays autorelease: pending after the fix, so runs keep aborting; relabel it and re-run as in references/troubleshooting.md.

Per-Package extra-files for Custom Version Locations

For JSON files, you must use the object format with type, path, and jsonpath:

{
  "packages": {
    "my-plugin": {
      "release-type": "simple",
      "extra-files": [
        {"type": "json", "path": ".claude-plugin/plugin.json", "jsonpath": "$.version"}
      ]
    }
  }
}

Key insight: For monorepo packages, extra-files paths are relative to the package directory, NOT the repo root. Release-please automatically prepends the package path.

Common Mistakes:

  1. Using a simple string path for JSON files:
// WRONG - won't update the version field
"extra-files": [".claude-plugin/plugin.json"]

// CORRECT - uses JSON updater with jsonpath
"extra-files": [
  {"type": "json", "path": ".claude-plugin/plugin.json", "jsonpath": "$.version"}
]
  1. Prepending the package path yourself (it gets doubled):
// WRONG - path becomes my-plugin/my-plugin/.claude-plugin/...
"extra-files": [
  {"type": "json", "path": "my-plugin/.claude-plugin/plugin.json", "jsonpath": "$.version"}
]

// CORRECT - path is relative to the package directory
"extra-files": [
  {"type": "json", "path": ".claude-plugin/plugin.json", "jsonpath": "$.version"}
]

File Type Formats:

File Type Format
JSON {"type": "json", "path": "...", "jsonpath": "$.version"}
YAML {"type": "yaml", "path": "...", "jsonpath": "$.version"}
TOML {"type": "toml", "path": "...", "jsonpath": "$.version"}; uv.lock, stale PR: uv-lock.md
XML {"type": "xml", "path": "...", "xpath": "//version"}
Plain text "path/to/version.txt" (string is fine; it uses the generic updater, whose silent failures are in generic-updater.md)

Adding a New Package to a Monorepo

  1. Update release-please-config.json:
{
  "packages": {
    "new-package": {
      "component": "new-package",
      "release-type": "simple",
      "extra-files": [
        {"type": "json", "path": ".claude-plugin/plugin.json", "jsonpath": "$.version"}
      ],
      "changelog-sections": [...]
    }
  }
}
  1. Update .release-please-manifest.json:
{
  "new-package": "1.0.0"
}
  1. Create the initial version file in the package if needed.

For the standard changelog-sections set and release-type table, see configure-plugin:configure-release-please.

Migrating from Shared Tags to Component Tags

When moving from v1.0.0 tags to component-v1.0.0 tags, follow references/tag-migration.md.

Monorepo Troubleshooting

When one package's release PR is not created, or a package's extra file gets the wrong version, see references/troubleshooting.md.

Quick Reference

For the commands that list pending release PRs, recent workflow runs, and a package's manifest version, see references/quick-reference.md.

Resources

04 同仓库更多 Skills