Skip to content

Commit 49ec1fb

Browse files
committed
docs: correct the release skill's two-group version-bump rule
The skill told you to bump all four version locations in one commit. Two of them — `.xlings.json` `workspace.mcpp` and `ci-fresh-install.yml` `MCPP_PIN` — are not "the current version" at all: they are the already-published version CI BOOTSTRAPS FROM. Moving them to the version being released makes every job try to `xlings install` something that does not exist yet. The skill already documented the correct sequence further down ("bootstrap pin 收尾"), so step 2 contradicted it. Git history agrees with the tail: fd27314 bumped only mcpp.toml and fingerprint.cppm, leaving the pin on 2026.7.28.2. Splits the four locations by the question each answers. The first group moves every release. The second is a bootstrap origin that does NOT track releases — lagging several versions is the normal state, the release flow leaves it alone, and advancing it is an occasional deliberate act whose one hard precondition is that the target version is already published and indexed. Also routes the bump through a PR (mcpp-contributing forbids direct pushes for version bumps too) and adds two failure rows: the all-red bootstrap symptom, and the stale `--version` you get from `ls | head -1` when the target/ fingerprint directory changed with the version.
1 parent 602f27b commit 49ec1fb

1 file changed

Lines changed: 45 additions & 16 deletions

File tree

.agents/skills/mcpp-release/SKILL.md

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,33 @@ description: Use when releasing a new version of mcpp — bumps version, creates
2424
2525
## Overview
2626

27-
mcpp 的版本号存在于 **四个位置**,发布时必须同步更新:
27+
mcpp 的版本号存在于 **四个位置**,但它们分属**两组,在发布流程的两个不同时刻更新**
28+
把四处一起 bump 是一个会让全部 CI 变红的经典错误 —— 见下面第二组的解释。
29+
30+
**第一组:正在构建的版本**(发布时改,走 bump PR)
2831

2932
1. `mcpp.toml``[package].version` — 构建系统读取的项目版本,release.yml 由它推导 tag
3033
2. `src/toolchain/fingerprint.cppm``MCPP_VERSION` — 编译期硬编码常量(`--version` 输出、BMI 指纹、E0006 索引底线比较)
34+
35+
这两处必须**在同一个 commit 里**一起改:`tests/e2e/01_help_and_version.sh` 交叉比对
36+
`mcpp.toml``mcpp --version`,只改一处 CI 立刻红。
37+
38+
**第二组:bootstrap pin —— CI 用哪个 mcpp 来自举**(发布并进索引之后才改)
39+
3140
3. `.xlings.json``workspace.mcpp` — CI bootstrap 装哪个 mcpp
3241
4. `.github/workflows/ci-fresh-install.yml``MCPP_PIN` — 全新安装验证的目标版本
3342

34-
**不一致会导致 release smoke test 失败**(CI 检查 `mcpp --version` 是否匹配 tag)。
35-
后两处历史上多次漂移(`MCPP_PIN` 曾落后五个版本),所以现在有机器校验:
43+
这两处指向的是一个**已经发布、且已经进了索引**的版本。在 bump PR 里把它们一起挪到新版,
44+
等于让每一个 CI job 去 `xlings install` 一个还不存在的 mcpp —— 全线红。
45+
所以它们在 bump PR 里保持**上一个已发布版本**不动,直到发布收尾那一步才前移
46+
(见「发布后的收尾」第 3 步)。`check_version_pins.sh` 正是按这个语义校验的:它只要求
47+
两处 pin **彼此相等**、且**不得新于**正在构建的版本,并不要求等于它。
48+
49+
对照最近一次发布:`fd27314`(bump 到 2026.7.29.1)只动了第一组两个文件,第二组仍停在
50+
2026.7.28.2;`fde3b70` 才在发布、镜像、进索引之后把 pin 推到 2026.7.29.1。
51+
52+
**版本不一致会导致 release smoke test 失败**(CI 检查 `mcpp --version` 是否匹配 tag)。
53+
第二组历史上多次漂移(`MCPP_PIN` 曾落后五个版本),所以现在有机器校验:
3654

3755
```bash
3856
bash .github/tools/check_version_pins.sh
@@ -55,27 +73,31 @@ gh run list --branch main --limit 3
5573

5674
所有 CI(ci / ci-macos / ci-windows)必须为 `success`。不要在 CI 红的时候发版。
5775

58-
### 2. 同步更新四处版本号(单个 commit)
76+
### 2. bump 版本号(第一组两处,单个 commit,走 PR
5977

60-
**关键:在同一个 commit 中更新全部四个文件,避免版本不一致。**
78+
**只改第一组的两个文件**,并且在同一个 commit 里。bootstrap pin(`.xlings.json`
79+
`MCPP_PIN`**不要动** —— 它们指向上一个已发布版本,见 Overview。
6180

6281
```bash
6382
# 日期版本:当天序号从 .1 起;.0 仅用于正式/稳定版
6483
NEW_VERSION="2026.7.27.1"
6584

85+
git checkout -b "chore/bump-$NEW_VERSION"
86+
6687
sed -i "s/^version.*=.*/version = \"$NEW_VERSION\"/" mcpp.toml
6788
sed -i "s/MCPP_VERSION = \".*\"/MCPP_VERSION = \"$NEW_VERSION\"/" src/toolchain/fingerprint.cppm
68-
sed -i "s/\"mcpp\": \"[^\"]*\"/\"mcpp\": \"$NEW_VERSION\"/" .xlings.json
69-
sed -i "s/MCPP_PIN: '[^']*'/MCPP_PIN: '$NEW_VERSION'/" .github/workflows/ci-fresh-install.yml
7089

71-
# 机器校验四处一致(同时校验 xlings pin),别靠肉眼
90+
# 机器校验(building 是新版、bootstrap pin 仍是旧版,是预期状态)
7291
bash .github/tools/check_version_pins.sh
7392

74-
# 单个 commit 提交
75-
git add mcpp.toml src/toolchain/fingerprint.cppm .xlings.json \
76-
.github/workflows/ci-fresh-install.yml
77-
git commit -m "chore: bump version to $NEW_VERSION"
78-
git push origin main
93+
# 自查:构建产物真的报新版本。注意 target/ 目录名带指纹哈希,
94+
# 版本一变就是新目录 —— 用 `ls -dt` 取最新的那个,`head -1` 会拿到旧二进制。
95+
mcpp build && "$(ls -dt target/*/*/bin/mcpp | head -1)" --version
96+
97+
git commit -am "chore: bump version to $NEW_VERSION"
98+
git push -u origin "chore/bump-$NEW_VERSION"
99+
gh pr create --title "chore: bump version to $NEW_VERSION" --body "..."
100+
# CI 绿后合入;版本 bump 同样禁止直推 main(见 mcpp-contributing)
79101
```
80102

81103
### 3. 创建并推送 tag
@@ -194,12 +216,17 @@ gh pr merge <n> --repo openxlings/xim-pkgindex --squash --admin
194216
# 2) 真实验证(注意:不带 @版本 不会升级已装的旧版)
195217
xlings update && xlings install mcpp@$NEW_VERSION -y
196218

197-
# 3) bootstrap pin 收尾,直推 main
198-
# .xlings.json 的 workspace.mcpp 与 ci-fresh-install.yml 的 MCPP_PIN
219+
# 3) bootstrap pin 收尾 —— 第二组两处,到这一步才前移
220+
# 新版此时已发布、已镜像、已进索引,CI 装得到,pin 才可以指向它
221+
sed -i "s/\"mcpp\": \"[^\"]*\"/\"mcpp\": \"$NEW_VERSION\"/" .xlings.json
222+
sed -i "s/MCPP_PIN: '[^']*'/MCPP_PIN: '$NEW_VERSION'/" .github/workflows/ci-fresh-install.yml
199223
bash .github/tools/check_version_pins.sh
200-
git commit -m "ci: workspace mcpp bootstrap pin -> $NEW_VERSION (released, mirrored, indexed)"
224+
git commit -am "ci: workspace mcpp bootstrap pin -> $NEW_VERSION (released, mirrored, indexed)"
201225
```
202226

227+
**顺序不能反**:pin 一旦领先于"索引里真实存在的版本",每个 CI job 的 bootstrap 都会
228+
`package 'mcpp@X.Y.Z' not found`。这就是 bump PR 里不许碰这两处的原因。
229+
203230
**索引传播有滞后**:索引 artifact 发布后,`latest` tag 上的指针文件在 GitHub
204231
资产 CDN 上可能还要几分钟才更新。紧接着跑的 CI 可能仍拿到旧索引并报
205232
`package 'mcpp@X.Y.Z' not found` —— 这不是 release 坏了,等指针稳定后重跑即可。
@@ -209,6 +236,8 @@ git commit -m "ci: workspace mcpp bootstrap pin -> $NEW_VERSION (released, mirro
209236
| 症状 | 原因 | 修复 |
210237
|------|------|------|
211238
| `mcpp X.Y.Z-1` 但 tag 是 `vX.Y.Z` | `fingerprint.cppm` 版本未更新 | 更新 `MCPP_VERSION`,重新打 tag |
239+
| bump PR 里**所有** CI job 都红在 bootstrap,报 `package 'mcpp@X.Y.Z' not found` | 把第二组的 bootstrap pin 也一起 bump 了,CI 去装一个还没发布的版本 |`.xlings.json` / `MCPP_PIN` 回退到上一个已发布版本,发布收尾时再前移 |
240+
| 自查 `--version` 显示旧版本,但源码已改 | `target/<triple>/<指纹>/` 的指纹随版本变,`ls \| head -1` 取到了上一次构建的目录 |`ls -dt … \| head -1` 取最新构建 |
212241
| Smoke test 输出旧版本 | CI 缓存了旧的 sandbox/target | 删除 GitHub Actions cache 后重跑 |
213242
| e2e `01_help_and_version.sh`| 只改了 `mcpp.toml` 没改 `fingerprint.cppm`(它把两者交叉比对) | 同步四处版本;注意这个 e2e 只在部分分片里跑,可能表现为"只有某个平台红" |
214243
| xlings bootstrap 失败 | xlings 版本不兼容 |`src/xlings.cppm::kXlingsVersion`**唯一真源**)后跑 `check_version_pins.sh` 找出其余 15 个 pin 点 |

0 commit comments

Comments
 (0)