AgentSkillsCN

release-please-development

当用户提出“设置发布流程”“配置自动化发布”“管理版本号”“添加变更日志自动化”,或提及release-please、语义化版本控制,或单体仓库版本管理时,应使用此技能。

SKILL.md
--- frontmatter
name: release-please-development
description: This skill should be used when the user asks to "set up release please", "configure automated releases", "manage version numbers", "add changelog automation", or mentions release-please, semantic versioning, or monorepo versioning.

Release Please Development

Configure automated versioning, changelog generation, and releases using Google's release-please.

Quick Reference

Overview

Release-please automates:

  • Version bumping based on conventional commits
  • CHANGELOG.md generation
  • GitHub release creation
  • Version updates in files (package.json, Chart.yaml, etc.)

Core Files

code
.github/
├── release-please-config.json    # Package configuration
├── release-please-manifest.json  # Current version tracking
└── workflows/
    └── release.yaml              # GitHub Actions workflow

When to Use Each Pattern

PatternUse Case
Single PackageLibraries, CLIs, simple apps with one version
Multi-PackageMonorepos, services with independent release cycles

Basic Setup

1. Create Config File

.github/release-please-config.json:

json
{
  "release-type": "simple",
  "packages": {
    ".": {
      "changelog-path": "CHANGELOG.md"
    }
  }
}

2. Create Manifest

.github/release-please-manifest.json:

json
{
  ".": "0.0.1"
}

3. Add GitHub Workflow

.github/workflows/release.yaml:

yaml
name: Release

on:
  push:
    branches: [main]

permissions:
  contents: write
  pull-requests: write

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: googleapis/release-please-action@v4
        with:
          config-file: .github/release-please-config.json
          manifest-file: .github/release-please-manifest.json

Release Types

TypeUse CaseVersions
simpleGeneric projectsCHANGELOG only
nodenpm packagespackage.json
pythonPython packagessetup.py, pyproject.toml
goGo modulesgo.mod
helmHelm chartsChart.yaml

Updating Extra Files

Use extra-files to update versions in arbitrary files:

json
{
  "packages": {
    ".": {
      "extra-files": [
        {
          "type": "json",
          "path": "manifest.json",
          "jsonpath": "$.version"
        }
      ]
    }
  }
}

Claude Code Plugin Marketplaces

For marketplaces with multiple plugins sharing a single version:

json
{
  "release-type": "simple",
  "packages": {
    ".": {
      "changelog-path": "CHANGELOG.md",
      "extra-files": [
        {
          "type": "json",
          "path": ".claude-plugin/marketplace.json",
          "jsonpath": "$.plugins[0].version"
        },
        {
          "type": "json",
          "path": ".claude-plugin/marketplace.json",
          "jsonpath": "$.plugins[1].version"
        }
      ]
    }
  }
}

Add a jsonpath entry for each plugin in the marketplace. When adding new plugins, update both:

  1. .claude-plugin/marketplace.json - add the plugin entry
  2. .github/release-please-config.json - add jsonpath for the new plugin's version

Conventional Commits

Release-please uses commit prefixes to determine version bumps:

PrefixVersion BumpExample
feat:Minor (0.x.0)New feature
fix:Patch (0.0.x)Bug fix
feat!: or BREAKING CHANGEMajor (x.0.0)Breaking change
docs:, chore:, etc.NoneNo release

How It Works

  1. Push commits to main with conventional commit messages
  2. Release-please creates/updates a release PR
  3. Merge the release PR to create a GitHub release
  4. Tags and changelog are automatically generated

See Also