[Feature] 发布流程生成签名更新源与增量补丁,并在发行构建中注入更新源

Open
#1,913 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
github-actions, go

Research direction

Start with cmd/viva/feed.go to see the flags (-key, -base-url, -channel, -version, --patch-from) and how latest.json is signed, then read desktop/internal/buildinfo/update.go for the link-time update variables. Next, wire the injection and the feed step into .github/workflows/desktop-release.yml and desktop-autobuild.yml. Done means a signed latest.json and patch are published, and the verify script scripts/desktop/verify/verify-runtime-bundle-immutability.sh passes. The maintainer decisions on key custody, hosting and channels must be settled first.

Written by the indexing model from the issue text.

Description

area:other enhancement P1 platform:cross-platform review: high
Problem to solve / 要解决的问题

Viva 桌面端(desktop/)已经实现应用内更新和增量更新:从带 Ed25519 签名的 latest.json 检查新版本,发布源为当前版本列出补丁时只下载补丁,在临时目录里从已安装的应用生成新版本后安装,补丁任一步失败就改下完整包(客户端改动见分支 feat/desktop-delta-updates 的 PR)。

但发布流程还没有接上,这套更新对用户是不可用的:

  • 更新源地址、公钥和渠道只能在链接时注入(desktop/internal/buildinfo/update.go 的 UpdateFeedURL、UpdatePublicKeys、UpdateChannel,用 -X 注入)。.github/workflows/desktop-release.yml 和 desktop-autobuild.yml 都没有注入,所以发行构建的“更新”页只显示未配置,不会检查更新。
  • 发布流程不生成、也不发布签名的 latest.json,也不为上一版生成增量补丁。

现在 Viva 预览版的用户每次都要手动下载完整安装包;增量更新的客户端代码合入后也一直不会被用到。

Proposed solution / 建议方案

在 Viva 桌面端的发布流程里生成并发布签名更新源和增量补丁,并在发行构建里注入更新源:

  1. 用 viva update-keygen 生成 Ed25519 密钥对。私钥存为 Actions secret(viva feed 默认读取 VIVA_UPDATE_KEY),公钥通过 UpdatePublicKeys 注入发行构建。私钥不进仓库。
  2. 确定 latest.json 和各平台安装包的托管位置,得到一个稳定的 HTTPS 地址注入 UpdateFeedURL。注意:预发布用 desktop-v* 标签发布为 prerelease,GitHub 的 releases/latest 不包含 prerelease,不能直接当作固定地址。
  3. 各平台在自己的 runner 上打包,发布作业再把全部安装包下载到 dist/ 上传。在发布作业上传前运行 viva feed -dir dist -base-url <托管地址> -channel <渠道> -version <版本>,生成签名的 latest.json。对 macOS 和 Linux 的每个架构,下载上一版已发布的归档(macOS 是已签名、已公证的 zip),用 --patch-from <os>/<arch>=<上一版版本>=<上一版归档> 生成补丁。补丁必须基于上一版发布包的精确字节,否则客户端校验失败后会回退到完整包。
  4. 按 #1794 P6 的要求,用真实签名产物演练:上一版到下一版的完整更新、增量更新、补丁不可用时回退到完整包,以及运行后安装包内容不变(scripts/desktop/verify/verify-runtime-bundle-immutability.sh)。

需要维护者决定的事项:私钥由谁生成和保管、托管位置、预览版与正式版是否分渠道。

Target platform / 目标平台

Cross-platform / 跨平台

Area / 模块

Other / 其他

Priority / 优先级

P1 / 尽快处理:使用体验大幅下降,但通常仍可继续使用

Alternatives considered / 已考虑的替代方案
  • 继续让用户手动下载完整安装包:可以用,但应用内更新和增量更新的客户端实现都用不上。
  • 只发布 latest.json、先不生成补丁:客户端会只下载完整包,可以作为第一步;--patch-from 在同一个 viva feed 命令里加上即可,不需要另一套流程。
  • 沿用旧 Lithe 的 Sparkle appcast:不可行。按 #1794,新包是新产品(app.lithe.viva),自建更新通道,不衔接旧 Lithe 的 Sparkle 更新链。
Additional context / 补充信息
  • 总体计划:#1794 的 P6(新包签名、发行与更新/回退演练)。
  • 生成源的命令:Viva cmd/viva/feed.go(-key 或 VIVA_UPDATE_KEY、-base-url、-channel、--patch-from os/arch=version=archive,补丁目前只支持 darwin 和 linux)。
  • Windows 增量更新另开 Issue 跟进;Windows 的发布源只列完整安装包时,客户端直接下载完整包。
  • 本 Issue 不涉及日志、诊断材料或用户数据。
Checklist / 提交前检查
  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
Dominant language
TypeScript
Stars
1.8k
Forks
151
Avg merge
3h 48m
Merged PRs (30d)
571

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 1lck/Lithe-IDEA

All issues in 1lck/Lithe-IDEA

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.