prepare-release

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

执行流程

Execution Process

步骤 1: 版本重置

Step 1: Version Reset

1.1 获取远程版本

1.1 Fetch Remote Version

bash
git fetch origin main
bash
git fetch origin main

1.2 检查哪些插件有修改

1.2 Check Which Plugins Have Modifications

bash
git diff --name-only origin/main -- plugins/
根据输出判断哪些插件目录有变更,只有变更的插件才需要更新版本。
bash
git diff --name-only origin/main -- plugins/
Determine which plugin directories have changes based on the output. Only plugins with changes need version updates.

1.3 读取生产版本号

1.3 Read Production Version Numbers

获取 origin/main 的 marketplace 版本和有修改的插件版本:
bash
undefined
Get the marketplace version of origin/main and the versions of modified plugins:
bash
undefined

marketplace 版本

Marketplace version

git show origin/main:.claude-plugin/marketplace.json | jq -r '.metadata.version'
git show origin/main:.claude-plugin/marketplace.json | jq -r '.metadata.version'

指定插件版本

Specified plugin version

git show origin/main:.claude-plugin/marketplace.json | jq -r '.plugins[] | select(.name=="<plugin>") | .version'
undefined
git show origin/main:.claude-plugin/marketplace.json | jq -r '.plugins[] | select(.name=="<plugin>") | .version'
undefined

1.4 计算新版本号

1.4 Calculate New Version Number

将获取的生产版本的 patch 版本 +1。
示例:
  • 生产 marketplace:
    0.1.10
    → 重置为
    0.1.11
  • 生产 sync:
    0.1.10
    → 重置为
    0.1.11
Increment the patch version of the obtained production version by 1.
Examples:
  • Production marketplace:
    0.1.10
    → Reset to
    0.1.11
  • Production sync:
    0.1.10
    → Reset to
    0.1.11

1.5 更新版本文件

1.5 Update Version Files

只更新有修改的插件
  1. .claude-plugin/marketplace.json
    • metadata.version
      (总是更新)
    • 有修改的插件的
      version
  2. plugins/<name>/.claude-plugin/plugin.json
    • 只更新有修改的插件
未修改的插件保持原版本不变。
重要:仅在
.claude-plugin/marketplace.json
中注册的插件才参与版本重置。本地开发中但未注册的插件(如 ralph 等)需先从 marketplace.json 删除其条目,或直接忽略。
Only update plugins with changes:
  1. .claude-plugin/marketplace.json
    • metadata.version
      (always update)
    • version
      of plugins with changes
  2. plugins/<name>/.claude-plugin/plugin.json
    • Only update plugins with changes
Plugins without changes retain their original versions.
Important: Only plugins registered in
.claude-plugin/marketplace.json
are involved in version reset. Unregistered plugins in local development (such as ralph, etc.) need to have their entries removed from marketplace.json first, or be ignored directly.

步骤 2: 更新 CHANGELOG.md

Step 2: Update CHANGELOG.md

在文件顶部(
# Changelog
标题之后)插入新版本条目。
Insert the new version entry at the top of the file (right after the
# Changelog
heading).

格式

Format

markdown
undefined
markdown
undefined

{marketplace_version}

{marketplace_version}

{Plugin Name} ({plugin_version})

{Plugin Name} ({plugin_version})

  • Added ...
  • Changed ...
  • Fixed ...
  • Added ...
  • Changed ...
  • Fixed ...

Marketplace

Marketplace

  • Bumped version from {old_marketplace_version} to {new_marketplace_version}
  • Updated {plugin} plugin to version {plugin_version}
undefined
  • Bumped version from {old_marketplace_version} to {new_marketplace_version}
  • Updated {plugin} plugin to version {plugin_version}
undefined

规则

Rules

  • 每个有版本变更的插件一个子章节:
    ### {Plugin Name} ({plugin_version})
    • Plugin Name 使用首字母大写 + " Plugin" 后缀,如
      Sync Plugin
      Git Plugin
  • 使用
    git log origin/main..HEAD -- plugins/{name}/
    获取该插件的变更摘要
  • 必须使用英文编写条目(Added/Changed/Fixed/Cleaned up/Updated 等前缀)
  • 末尾加
    ### Marketplace
    段落,列出 bumped version 和 updated plugins
  • One sub-section for each plugin with version changes:
    ### {Plugin Name} ({plugin_version})
    • Plugin Name uses capitalized first letters + " Plugin" suffix, such as
      Sync Plugin
      ,
      Git Plugin
  • Use
    git log origin/main..HEAD -- plugins/{name}/
    to get the change summary for the plugin
  • Must write entries in English (use prefixes like Added/Changed/Fixed/Cleaned up/Updated, etc.)
  • Add a
    ### Marketplace
    section at the end, listing bumped version and updated plugins

步骤 3: 更新插件 README 版本历史

Step 3: Update Plugin README Version History

对每个有版本变更的插件:
  1. 读取其
    plugins/{name}/README.md
  2. 检查是否存在
    ## 版本历史
    段落
  3. 如果存在,在该段落顶部(紧接
    ## 版本历史
    之后)插入新条目
For each plugin with version changes:
  1. Read its
    plugins/{name}/README.md
  2. Check if the
    ## 版本历史
    (Version History) section exists
  3. If it exists, insert the new entry at the top of this section (immediately after
    ## 版本历史
    )

格式

Format

markdown
- **v{version}** - {中文摘要,分号分隔}
示例:
markdown
- **v0.1.12** - 新增 XXX 命令;修复 YYY 问题;更新 ZZZ 配置
仅处理有
## 版本历史
段落的 README
,没有该段落的跳过。
markdown
- **v{version}** - {Chinese summary, separated by semicolons}
Example:
markdown
- **v0.1.12** - Added XXX command; fixed YYY issue; updated ZZZ configuration
Only process READMEs with the
## 版本历史
section
, skip those without it.

步骤 4: 更新根目录 README.md

Step 4: Update Root Directory README.md

更新
## 插件列表
表格中有版本变更的插件版本号。
表格格式参考:
markdown
| 插件      | 版本    | 描述                                                                |
| ------- | ----- | ----------------------------------------------------------------- |
| sync    | 0.1.12 | 开发环境配置同步插件(...) |
仅更新有版本变更的行,其他行保持不变。
Update the version numbers of plugins with version changes in the
## Plugin List
table.
Table format reference:
markdown
| Plugin   | Version | Description                                                                |
| ------- | ----- | ----------------------------------------------------------------- |
| sync    | 0.1.12 | Development environment configuration sync plugin (...) |
Only update rows with version changes, keep other rows unchanged.

步骤 5: 校验

Step 5: Verification

逐一确认以下位置的版本号一致性:
  1. .claude-plugin/marketplace.json
    中的
    metadata.version
  2. .claude-plugin/marketplace.json
    中各插件的
    version
  3. plugins/<name>/.claude-plugin/plugin.json
    中的
    version
  4. CHANGELOG.md
    顶部条目的版本号
  5. 根目录
    README.md
    插件列表表格中的版本号
  6. 各插件
    README.md
    版本历史顶部条目的版本号(如有)
输出校验结果表格供用户确认:
| 位置                          | 插件   | 版本    | 状态 |
| ----------------------------- | ------ | ------ | ---- |
| marketplace.json (metadata)   | -      | 0.1.16 | ✅   |
| marketplace.json (plugin)     | sync   | 0.1.12 | ✅   |
| plugin.json                   | sync   | 0.1.12 | ✅   |
| CHANGELOG.md                  | sync   | 0.1.12 | ✅   |
| README.md (root)              | sync   | 0.1.12 | ✅   |
| README.md (plugin)            | sync   | 0.1.12 | ✅   |
Verify the consistency of version numbers in the following locations one by one:
  1. metadata.version
    in
    .claude-plugin/marketplace.json
  2. version
    of each plugin in
    .claude-plugin/marketplace.json
  3. version
    in
    plugins/<name>/.claude-plugin/plugin.json
  4. Version number in the top entry of CHANGELOG.md
  5. Version number of plugins with changes in the plugin list table in root directory README.md
  6. Version number in the top entry of the version history in each plugin's README.md (if exists)
Output the verification result table for user confirmation:
| Location                      | Plugin | Version | Status |
| ----------------------------- | ------ | ------ | ---- |
| marketplace.json (metadata)   | -      | 0.1.16 | ✅   |
| marketplace.json (plugin)     | sync   | 0.1.12 | ✅   |
| plugin.json                   | sync   | 0.1.12 | ✅   |
| CHANGELOG.md                  | sync   | 0.1.12 | ✅   |
| README.md (root)              | sync   | 0.1.12 | ✅   |
| README.md (plugin)            | sync   | 0.1.12 | ✅   |