feat(devops): 发版拆分为 client/site/server 三条独立流水线

将单一 CI/CD 流水线拆成三条互不影响的发布流水线,各有 tag 前缀、独立版本
序列与独立 CHANGELOG:

- client(client-v*):Flutter 全平台 + version.yaml 自更新清单
- site(site-v*):web/ Eleventy 营销站,不含 web 版 app
- server(server-v*):backend Go 服务 + 共享基建 nginx/systemd

新增 3 个 workflow(deploy-client/site/server.yml)替换 deploy.yml;CI 脚本
按 part 拆分为 compile-/release-/deploy-{client,site,server}.sh,抽出公共函数
lib-forgejo.sh;compile-{macos,android,ios,windows}.sh 改去 client-v 前缀;
manual.yml 按前缀路由回滚。

跨流水线解耦:version.yaml 归 client,后端每请求实时读取(不重启、不触发
server 流水线);官网下载页的版本徽章/下载链接/更新日志时间线运行时经
/api/v1/public/release 动态拉取(API 不可达回退构建时静态内容)。为此一次性
扩展后端 changelog 字段(version.go/public.go)与 download.njk 动态渲染。

CHANGELOG.md 重命名为 CHANGELOG-client.md,新增 CHANGELOG-site/server.md;
重写 /release 命令为 /release <part> [version];同步更新 CLAUDE.md 与部署文档。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-17 08:21:28 +08:00
parent eca62ba2c3
commit aa7099ba94
39 changed files with 998 additions and 534 deletions
+2
View File
@@ -183,6 +183,7 @@ func (h *PublicHandler) GetRelease(c *gin.Context) {
"version": "1.0.0",
"release_notes": "",
"download_urls": gin.H{"web": "https://jiu.51yanmei.com/app"},
"changelog": []changelogEntry{},
})
return
}
@@ -190,6 +191,7 @@ func (h *PublicHandler) GetRelease(c *gin.Context) {
"version": cfg.Version,
"release_notes": cfg.ReleaseNotes,
"download_urls": cfg.DownloadURLs,
"changelog": changelogOrEmpty(cfg.Changelog),
})
}
+24
View File
@@ -17,6 +17,29 @@ type versionConfig struct {
ForceUpdate bool `yaml:"force_update"`
ReleaseNotes string `yaml:"release_notes"`
DownloadURLs map[string]string `yaml:"download_urls"`
// Changelog 由 client 发版脚本从 CHANGELOG-client.md 写入(最近 3 条),
// 供官网下载页运行时拉取渲染更新日志,无需重建官网。
Changelog []changelogEntry `yaml:"changelog"`
}
type changelogEntry struct {
Version string `yaml:"version" json:"version"`
Date string `yaml:"date" json:"date"`
Intro string `yaml:"intro" json:"intro"`
Sections []changelogSection `yaml:"sections" json:"sections"`
}
type changelogSection struct {
Type string `yaml:"type" json:"type"`
Items []string `yaml:"items" json:"items"`
}
// changelogOrEmpty 保证响应里 changelog 始终是数组(而非 null),方便前端遍历。
func changelogOrEmpty(c []changelogEntry) []changelogEntry {
if c == nil {
return []changelogEntry{}
}
return c
}
// GetVersion GET /version
@@ -33,6 +56,7 @@ func GetVersion(c *gin.Context) {
"force_update": cfg.ForceUpdate,
"release_notes": cfg.ReleaseNotes,
"download_urls": cfg.DownloadURLs,
"changelog": changelogOrEmpty(cfg.Changelog),
})
}