Skip to content

ci: 一键全平台发版流程 - #2

Merged
BeetMan merged 1 commit into
mainfrom
ci/release-pipeline
Oct 30, 2026
Merged

BeetMan merged 1 commit into
mainfrom
ci/release-pipeline

Conversation

@BeetMan

@BeetMan BeetMan commented Oct 30, 2026

Copy link
Copy Markdown
Owner

概要

在 GitHub Actions 中加入一键全平台发版:填版本号,就会自动完成版本同步、提交、打标签、全平台构建和发布 Release。

用法

  1. 在 docs/更新日志-X.Y.md 中写好 ## X.Y.Z 小节并推送到 main
  2. 打开 Actions → Release → Run workflow,填写版本号(可勾选"草稿")

本地同步版本号后直接推送 vX.Y.Z 标签的方式仍然可用。

改动

  • build.yml(新增):检查 + 全平台构建,只上传产物。每个 PR 都会运行,也可以手动运行,或由发版流程传入标签调用
  • release.yml(重写):
    • prepare:校验版本号(格式、不低于当前版本、标签不存在、更新日志有对应小节),手动发版时同步版本号、提交 release: prepare version X.Y.Z,并原子推送 main 和标签
    • build:调用 build.yml 构建该标签
    • publish:生成 SHA256SUMS.txt,正文由更新日志小节和下载表组成,创建 Release;重跑时更新已有 Release 并覆盖同名文件
  • 新增平台:Windows ARM64(在 x64 runner 上交叉编译)、Linux ARM64(ubuntu-22.04-arm),Linux 新增 .rpm
  • scripts/project.mjs:新增 release-notes <version> 命令,提取对应更新日志小节,缺失时报错
  • 文档:README、项目维护说明、打包说明更新发版步骤和产物清单

验证

  • actionlint 通过(包括 shellcheck)
  • 本地模拟产物收集脚本(含交叉编译目标路径、多产物,以及缺文件时报错)
  • 本地模拟 Release 正文生成(6.5.0 更新日志)
  • npm run check 通过
  • 本 PR 的 build.yml:7 个构建任务(新增的 Windows ARM64、Linux ARM64、.rpm 是第一次构建)
  • release.yml 只能在真正发版时完整运行,建议第一次发版时勾选"草稿"

🤖 Generated with Claude Code

- Split build.yml (checks + all-platform builds, runs on every PR and
  can be called with a ref) from release.yml (prepare, build, publish)
- release.yml workflow_dispatch takes a version: validates it, syncs all
  version fields, commits to main, tags, builds, and publishes the release;
  pushing a vX.Y.Z tag still works and skips the version commit
- Release notes come from the "## X.Y.Z" section of docs/更新日志-X.Y.md
  (new `release-notes` command in scripts/project.mjs); optional draft mode;
  reruns update the existing release
- New targets: Windows ARM64, Linux ARM64, and .rpm for Linux
- Docs describe the new release steps and artifacts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BeetMan
BeetMan merged commit 61683fc into main Oct 30, 2026
7 checks passed
@BeetMan
BeetMan deleted the ci/release-pipeline branch October 30, 2026 18:22
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