fix(release): put English before Chinese

This commit is contained in:
AAA committed 2026-10-19 22:52:05 +08:00
1 parent e1178afba6
commit dd208e8312
6 files changed
+17 -16

No files matched your search

+3 -3
View File
@@ -9,14 +9,14 @@
<!-- Required for product-changing PRs; omit this section for standalone website/docs/maintenance work. Public copy, automatically published in GitHub Releases. Keep this exact heading; use ### for subsections. Describe user benefits, fixes and required upgrade actions in concise Chinese and English. Omit internal logs, audit prompts and unverified claims. 产品改动需填写公开的中英文更新说明;仅官网、文档或外围维护可删去此节。 -->
<!-- Follow docs/standards/versioning.md#release-notes. Keep the public Release title Piik vX.Y.Z.
An optional editorial headline opens the body as two bold plain-text paragraphs: Chinese, then English.
An optional editorial headline opens the body as two bold plain-text paragraphs: English, then Chinese.
Keep/change/omit it by editorial relevance, independently of semver. A released feature, verified community
milestone, thanks or light aside is fine; do not present an old feature as new or promise a prototype.
Then use ### 中文 and ### English to explain THIS update: actual benefits, fixes and required actions.
Then use ### English followed by ### 中文 to explain THIS update: actual benefits, fixes and required actions.
Group details only when useful. Serious upgrade instructions take precedence over playful copy.
Preview the complete generated release, including earlier unpublished changes: one bilingual headline at most.
The last product PR supplies that headline (or omits it); earlier PRs retain their actual changes.
正文可先写一组双语主题:中文、英文各一个 **纯文本粗体段落**。按内容决定沿用、换掉或省略,与版本位无关。
正文可先写一组双语主题:先英文、后中文,各一个 **纯文本粗体段落**。按内容决定沿用、换掉或省略,与版本位无关。
主题可以讲已上线功能、真实社区里程碑或轻松小事;随后必须明确“本次更新”改了什么,不用俏皮话代替事实。
合并前检查整份生成文案和官网摘句,勿重复主题、误报新功能或手工复制另一份文案。
-->
+2 -2
View File
@@ -180,8 +180,8 @@ reserve `spike/` for experiments. No issue number is required. 中文说明:PR
A pull request should explain the problem, the chosen design, verification performed, user-visible or operational effects, and remaining risks.
Before a product-changing integration PR is accepted, fill its exact `## Release notes` section
with concise public copy in Chinese and English: user-visible changes, fixes and
required upgrade actions. Use `###` for subsections. Review this text as product
with concise public copy in English followed by Chinese: user-visible changes,
fixes and required upgrade actions. Use `###` for subsections. Review this text as product
copy; it is published automatically from the squash commit, without PR discussion
or verification logs. The [release-note policy](./docs/standards/versioning.md#release-notes)
owns the optional editorial headline, aggregation and preview. Review the
+6 -5
View File
@@ -240,7 +240,7 @@ apply. Preserve the original image and packages for retries.
## Release Notes
GitHub Releases owns the published changelog. Each product-changing PR supplies reviewed
Chinese and English user-facing copy under the exact `## Release notes` heading
English and Chinese user-facing copy under the exact `## Release notes` heading
in its squash commit; `###` headings structure that copy. Explain benefits,
fixes and required upgrade actions, including breaking changes. Keep internal
work logs, audit handoffs and unverified claims outside this public section.
@@ -278,8 +278,8 @@ thanks or an occasional light aside can lead. Keep Piik's friendly tone without
forced jokes; never turn an old feature into a claim that it is new in this
update, advertise an unfinished prototype or trivialize a serious failure.
When used, write the headline as the first two bold paragraphs, Chinese then
English, with plain text inside `**...**`. The website reads this same pair from
When used, write the headline as the first two bold paragraphs, English then
Chinese, with plain text inside `**...**`. The website reads this same pair from
the published Release body and displays the current language; it does not keep
another copy, interpret arbitrary Markdown or guess a headline from older
releases. Gitee retains the same body. Do not add a campaign registry or automatic
@@ -295,8 +295,9 @@ Then group concrete changes under useful headings such as highlights, fixes,
upgrade instructions or known limitations. Omit empty categories and routine
implementation/test inventories. A small fix may need only its introduction and
a few bullets. Required upgrade steps or interruptions must be easy to find.
Chinese and English cover the same release facts with natural phrasing. Use
`###` for language sections and `####` for categories when both are needed.
English and Chinese cover the same release facts with natural phrasing, with
English first. Use `###` for language sections and `####` for categories when
both are needed.
The approved final description must read as one release when several unpublished
commits are included. Preview the rendered aggregate with at most one bilingual
+2 -2
View File
@@ -1,11 +1,11 @@
// The release editor owns two leading bold paragraphs: Chinese, then English.
// The release editor owns two leading bold paragraphs: English, then Chinese.
// Read only that pair; older release prose is not an inferred headline.
export function splitReleaseHeadline(body) {
if (typeof body !== "string") return { headline: null, notes: "" };
const opening = /^\s*\*\*([^*\r\n]+)\*\*[ \t]*\r?\n(?:[ \t]*\r?\n)+\*\*([^*\r\n]+)\*\*(?:[ \t]*\r?\n(?:[ \t]*\r?\n)+|[ \t]*$)/.exec(body);
if (!opening || !opening[1].trim() || !opening[2].trim()) return { headline: null, notes: body };
return {
headline: { "zh-CN": opening[1].trim(), en: opening[2].trim() },
headline: { en: opening[1].trim(), "zh-CN": opening[2].trim() },
notes: body.slice(opening[0].length).trimStart(),
};
}
+1 -1
View File
@@ -53,7 +53,7 @@ export function releaseNotes(root, version, revision, repository, { allowEmpty =
const source = previous
? `[完整变更 / Full changelog](${url}/compare/${previous}...${revision})`
: `[源代码 / Source](${url}/tree/${revision})`;
const opening = headline ? `**${headline["zh-CN"]}**\n\n**${headline.en}**\n\n` : "";
const opening = headline ? `**${headline.en}**\n\n**${headline["zh-CN"]}**\n\n` : "";
return `${opening}${bodies.join("\n\n")}\n\n---\n\n${source}\n`;
}
+3 -3
View File
@@ -14,7 +14,7 @@ const sha = (value: string) => createHash("sha256").update(value).digest("hex");
describe("release automation", () => {
it("shares only an authored leading bilingual headline with the website", () => {
const opening = "**远程同乐,轮到你啦!**\n\n**Play together. Your turn!**";
const opening = "**Play together. Your turn!**\n\n**远程同乐,轮到你啦!**";
expect(splitReleaseHeadline(`${opening}\n\n### 中文\n\n修复开播。`)).toEqual({
headline: { "zh-CN": "远程同乐,轮到你啦!", en: "Play together. Your turn!" },
notes: "### 中文\n\n修复开播。",
@@ -102,8 +102,8 @@ describe("release automation", () => {
cwd: root, encoding: "utf8", env: { ...process.env, PIIK_BUILD_VERSION: "v1.0.1" },
}));
expect(candidate).toMatchObject({ version: "v1.0.1", publish: false });
commit("fix: repair playback\n\n## Release notes\n**旧主题**\n\n**Earlier theme**\n\n- Playback resumes after reconnecting.");
const opening = "**远程同乐,轮到你啦!**\n\n**Play together. Your turn!**";
commit("fix: repair playback\n\n## Release notes\n**Earlier theme**\n\n**旧主题**\n\n- Playback resumes after reconnecting.");
const opening = "**Play together. Your turn!**\n\n**远程同乐,轮到你啦!**";
const next = commit(`feat: add a sharing option\n\n## Release notes\n${opening}\n\n- Choose a window to share.`);
const notes = releaseNotes(root, "v1.1.0", next, "fixture/Piik");
expect(notes.startsWith(opening)).toBe(true);