Skip to content

ci(release): take notes from the CHANGELOG section for the tag - #60

Merged
RevolutionLA merged 1 commit into
mainfrom
ci/release-notes
Oct 9, 2026
Merged

RevolutionLA merged 1 commit into
mainfrom
ci/release-notes

Conversation

@RevolutionLA

Copy link
Copy Markdown
Owner

问题

发布页的正文是工作流里写死的一句话,所以 v0.2.0 / v0.3.0 / v0.3.1 三个 release 的 notes 逐字节相同。用户站在 releases 页上 deciding 要不要更新,看到的却是"这是个离线语音输入"——等于什么都没说。我今天发 0.3.1 时是手动改正文才补上的(见 v0.3.1 页面),这一步就是让下一版自动如此。

改了什么

上一步的版本门已经证明 debian/changelog 与 tag 一致,CHANGELOG.md 就在那份构建副本里 —— 于是:

  • 用 awk 取出 ## [<版本>] 那一节作为正文,后面附上真正会被复制的安装命令;
  • 取不到对应小节(比如手工 tag 了一个不存在的版本)时不阻断发布(产物和版本门才是契约),但打一条 ::warning:: 注解,而不是安静地发一个空正文。

验证

这个步骤我在本地真跑过:stub 掉 gh,用真实的 CHANGELOG.md 副本按 YAML 解出的脚本执行——

  • v0.3.1 → 抽出 116 行 + blurb;
  • v9.9.9 → 抽不出内容 → 走 warning 分支;
    两种都 rc=0。
    (选这条验证方式是因为上次发布被浪费就是这么来的:CI job 里"在副本里构建"却没 cd 进去,绿灯一路到发布才炸。)

heredoc 终止符 BLURB 与块内容同级缩进(YAML 去掉公共缩进后才是 shell 需要的列 0),这一点也在本地模拟里覆盖到了。

Every release so far published the same hard-coded sentence: v0.2.0, v0.3.0 and
v0.3.1 shipped byte-identical notes, so the page told someone deciding whether
to update exactly nothing about what changed. The version gate above this step
already proves debian/changelog agrees with the tag, so CHANGELOG.md is right
there in the build copy - extract its section for this version and append the
install blurb people actually copy.

An unknown tag yields an empty section: that is not fatal (the artefacts and the
gate are the contract) but it should be visible, so the step emits a
::warning:: annotation rather than publishing silence.

The step was executed locally against a stubbed gh and a copy of the real
CHANGELOG: v0.3.1 extracts 116 lines plus the blurb, v9.9.9 extracts nothing and
warns, exit 0 either way.
@RevolutionLA
RevolutionLA merged commit c602c29 into main Oct 9, 2026
4 checks passed
@RevolutionLA
RevolutionLA deleted the ci/release-notes branch October 9, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant