Repository navigation
ci(release): take notes from the CHANGELOG section for the tag - #60
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
发布页的正文是工作流里写死的一句话,所以 v0.2.0 / v0.3.0 / v0.3.1 三个 release 的 notes 逐字节相同。用户站在 releases 页上 deciding 要不要更新,看到的却是"这是个离线语音输入"——等于什么都没说。我今天发 0.3.1 时是手动改正文才补上的(见 v0.3.1 页面),这一步就是让下一版自动如此。
改了什么
上一步的版本门已经证明
debian/changelog与 tag 一致,CHANGELOG.md就在那份构建副本里 —— 于是:## [<版本>]那一节作为正文,后面附上真正会被复制的安装命令;::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),这一点也在本地模拟里覆盖到了。