From 782bea111520057ccdcfe323ca0875c14b93558d Mon Sep 17 00:00:00 2001 From: Christ Date: Thu, 13 Aug 2026 21:16:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E7=A8=8B=E5=BA=8F=E7=8E=B0?= =?UTF-8?q?=E7=8A=B6=E5=B9=B6=E5=AE=8C=E5=96=84=E7=89=88=E6=9C=AC=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 13 +++++++------ README.md | 20 ++++++++++++++------ docs/index.html | 2 +- docs/wiki/Home.md | 11 ++++++++++- docs/wiki/部署与数据库.md | 22 ++++++++++++++++++++++ frontend/README.md | 3 +++ 6 files changed, 57 insertions(+), 14 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 71b598f..bd85b01 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -109,13 +109,14 @@ All desktop packages contain the matching Playwright driver, Chromium and headle Debian Chromium package or download a second browser during installation. The Docker final image uses `node:24-trixie-slim`, copies the cached runtime prepared by CI, installs only the Chromium system libraries through the bundled Playwright driver, and clears apt indexes and temporary caches in the same image layer. -The desktop CI workflow runs on `main`, `codex/desktop-packaging`, and `v*.*.*` version tags; Linux amd64 and -arm64 jobs use native GitHub-hosted runners and +The desktop CI workflow runs on `main` and `dev`; formal desktop builds are invoked by the unified +`release.yml` workflow for `v*.*.*` version tags. Linux amd64 and arm64 jobs use native GitHub-hosted runners and must not use QEMU or cross-architecture emulation. Docker publishing also builds each architecture on its native -runner and publishes `main` and `latest` from `main`, `desktop-packaging` and `alpha` from -`codex/desktop-packaging`, and semantic version tags from `v*.*.*`. Version tags also create a GitHub Release -containing all platform packages and SHA-256 checksums. Never publish a Docker manifest until Go/frontend tests, -an actual Chromium launch, and the packaged server health check have passed for every architecture. +runner: branch builds publish `main` or `dev` plus a full-commit `sha-*` tag, while formal builds publish semantic +version tags, `latest`, and the full-commit `sha-*` tag only after the `production-release` Environment approval. +Version tags create a GitHub Release containing all platform packages and SHA-256 checksums. Never publish a Docker +manifest until Go/frontend tests, an actual Chromium launch, and the packaged server health check have passed for +every architecture. The tray state machine is shared by Windows and macOS: it serializes actions, shows transition states, waits for a healthy `/health` response after start/restart, waits for the endpoint to become unreachable diff --git a/README.md b/README.md index 6219552..55b3bfa 100644 --- a/README.md +++ b/README.md @@ -208,13 +208,15 @@ Windows 和 macOS 托盘启动时会自动启动后台服务,并显示检查 `/var/log/ydisks-xianyu-helper/server.log`,也可以使用 `journalctl -u ydisks-xianyu-helper.service` 查看。 -桌面端安装包由 GitHub Actions 工作流在 `dev`、`main` 分支以及 `v1.2.3` 格式的版本标签上构建: +桌面端安装包由 `.github/workflows/desktop-cd.yml` 在 `dev`、`main` 分支上持续构建;正式版本由统一的 +`.github/workflows/release.yml` 在 `v1.2.3` 格式的版本标签上协调构建: Linux 上传 amd64/arm64 tar 包,Windows 上传安装器,macOS 分别上传 arm64 和 amd64 安装包。 分支构建只保留非正式 Actions artifacts;版本标签必须指向 `main` 中的提交,全部桌面端和 Docker 构建验证成功后等待 `production-release` Environment 人工审批,审批通过才创建 GitHub Release、 上传各平台安装包及 `SHA256SUMS`,并发布正式 Docker 标签。Windows 和 macOS 安装包使用工作流中配置的固定签名证书签名;未配置对应 GitHub Secrets 时,签名 -步骤会失败,不会生成可分发的安装包。 +步骤会失败,不会生成可分发的安装包。当前仓库未配置正式签名证书时,Windows/macOS 正式发布 +会停在签名步骤;Linux 安装包不依赖桌面端签名证书。 Linux 安装包的 `install.sh` 必须在与安装包相同架构的 Linux 主机上以 root 执行。安装包已经 包含对应架构的 Playwright driver、Chromium 和 headless shell;安装时只安装 Chromium 所需 @@ -333,8 +335,11 @@ Docker Compose 还支持: | `XIANYU_BIND_ADDRESS` | `0.0.0.0` | 应用在宿主机上的绑定地址 | | `XIANYU_HTTP_PORT` | `59188` | 应用在宿主机上的端口 | -默认 `compose.yml` 直接拉取 GHCR 的 `:latest` 多架构镜像;如需固定版本,请将 -`XIANYU_IMAGE` 改为 `:main`、版本号或 `:sha-<提交号>` 标签。 +默认 `compose.yml` 直接拉取 GHCR 的 `:latest` 多架构镜像;如需固定版本,请把 +`XIANYU_IMAGE` 设置为完整镜像地址,例如 +`ghcr.io/christ9038/ydisks-xianyu-helper:v1.2.3`、 +`ghcr.io/christ9038/ydisks-xianyu-helper:main` 或 +`ghcr.io/christ9038/ydisks-xianyu-helper:sha-<完整提交号>`。 `XIANYU_DATA_KEY` 用于加密 Cookie、账号密码、设备令牌、访问令牌、AI/SMTP 密钥和 通知凭证。启用后,服务会自动升级历史明文数据。密钥丢失或更换后,已有加密数据将 @@ -476,12 +481,15 @@ curl -fsS http://127.0.0.1:59188/health docker compose logs --tail=200 app ``` -健康接口正常时返回: +健康接口正常时返回(构建信息会随运行方式变化): ```json -{"database":"ok","status":"ok"} +{"status":"ok","database":"ok","version":"dev","commit":"unknown","build_time":"unknown"} ``` +正式安装包和 Docker 镜像会注入对应版本、提交号和构建时间;源码运行默认显示 +`dev`/`unknown`。管理后台侧边栏底部也会显示当前运行版本和短提交号。 + ### 更新镜像 ```bash diff --git a/docs/index.html b/docs/index.html index 7f77e2f..a9a2e91 100644 --- a/docs/index.html +++ b/docs/index.html @@ -914,7 +914,7 @@
- Ydisks 闲鱼助手 Dashboard Preview + Ydisks 闲鱼助手 Dashboard Preview
diff --git a/docs/wiki/Home.md b/docs/wiki/Home.md index 516a41e..337ec81 100644 --- a/docs/wiki/Home.md +++ b/docs/wiki/Home.md @@ -22,6 +22,9 @@ 控制器以及匹配架构的 Playwright driver、Chromium;Linux 安装包自带相同的浏览器 runtime, 安装脚本只补齐系统依赖。桌面托盘退出前会先停止后台服务。 +管理后台侧边栏底部会显示当前运行版本和短提交号。源码运行默认显示 `dev`/`unknown`;正式安装包和 +Docker 镜像会显示构建时注入的正式版本与提交信息。 + Windows 安装包注册 `YdisksXianyuHelper` 服务;macOS 安装包分别提供 Apple Silicon(arm64)和 Intel(amd64)版本,并注册 `com.ydisks.xianyu-helper.server` 与 `com.ydisks.xianyu-helper.tray` 两个 LaunchAgent。Linux 安装包按 amd64/arm64 分发,执行 @@ -46,4 +49,10 @@ Intel(amd64)版本,并注册 `com.ydisks.xianyu-helper.server` 与 ## GitHub Wiki 同步 -这些 Markdown 文件位于仓库 `docs/wiki/`,可直接复制到 GitHub Wiki 对应页面;文件名即页面名。`_Sidebar.md` 是 Wiki 导航。仓库内保留副本便于在 Pull Request 中审阅和版本化维护。 +这些 Markdown 文件位于仓库 `docs/wiki/`,是 Wiki 的唯一维护来源;文件名即页面名,`_Sidebar.md` 是 +Wiki 导航。`main` 分支发生变更后,`.github/workflows/sync-wiki.yml` 会自动把这些文件镜像到 GitHub +Wiki;也可以通过 GitHub Actions 手动运行该工作流。仓库内保留副本,便于在 Pull Request 中审阅和版本化维护, +不建议直接在 GitHub Wiki 仓库中维护内容。 + +项目 Pages 站点使用 `main` 分支的 `/docs` 目录发布,域名由 `docs/CNAME` 中的配置决定;修改首页或图片资源 +后,合并到 `main` 即可由 GitHub Pages 发布。Pages 发布与 GitHub Wiki 同步是两个独立流程。 diff --git a/docs/wiki/部署与数据库.md b/docs/wiki/部署与数据库.md index 78cd228..996375f 100644 --- a/docs/wiki/部署与数据库.md +++ b/docs/wiki/部署与数据库.md @@ -26,6 +26,28 @@ Docker 中的自动续期会使用容器内 Chromium 检测到的 Linux 原生浏览器指纹请求闲鱼官网;不会因为宿主系统是 Linux 而跳过静默续期。续期结果仍以闲鱼响应和账号登录态为准。 +## 版本、镜像与正式发布 + +项目以 Git 标签作为正式版本来源,正式标签必须符合 `v1.2.3` 格式,并指向 `main` 已包含的提交。 +推送正式标签后,统一的 `.github/workflows/release.yml` 会重新从该标签提交构建桌面安装包和 Docker 镜像; +不会复用之前 `main` 分支构建的产物。 +构建、Chromium 启动和 `/health` 检查全部通过后,还需要 `production-release` Environment 人工审批, +审批通过才会创建 GitHub Release、上传安装包与 `SHA256SUMS`,并更新正式镜像标签。 + +Docker 标签规则如下: + +| Git 引用 | 镜像标签 | 是否正式发布 | +| --- | --- | --- | +| `dev` 分支 | `dev`、`sha-<完整提交号>` | 否,用于日常调试 | +| `main` 分支 | `main`、`sha-<完整提交号>` | 否,稳定候选构建 | +| `v1.2.3` 标签 | `v1.2.3`、`1.2.3`、`1.2`、`latest`、`sha-<完整提交号>` | 是 | + +`latest` 只在正式版本审批发布阶段更新,不会随 `main` 或 `dev` 分支提交变化。生产环境建议使用 +`v1.2.3`、`1.2.3` 或 SHA 标签固定版本;Compose 默认使用 `latest`。 + +当前 Windows 和 macOS 正式安装包的 CI 签名步骤仍需要对应的签名证书 Secrets;未配置时这些平台的 +正式发布会在签名步骤失败。Linux 安装包不依赖桌面端签名证书。 + ## 独立安装包 独立安装包与 Docker 使用同一套 Playwright Chromium 版本来源:Chromium、headless shell 和 diff --git a/frontend/README.md b/frontend/README.md index 05d1b5a..ce7e9ea 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -38,6 +38,9 @@ npm run build 生产部署无需单独分发前端。若 Go 服务已经运行,构建完成后必须重启 Go 服务, 因为嵌入资源在 Go 编译时写入服务二进制;仅刷新浏览器不会更新已运行进程中的前端版本。 +侧边栏底部的运行版本和短提交号来自后端 `/health` 接口。源码运行通常显示 `dev`/`unknown`;CI +构建的安装包和 Docker 镜像由构建参数注入对应版本信息。 + ## Dashboard 图表约定 Dashboard 的营收趋势柱状图使用统一的品牌蓝 `#0094f7` 表示同一指标序列,日期之间