Repository navigation
feat(linux): AppImage 嵌入更新信息并发布 .zsync 增量更新(AppImageUpdate/AppImageLauncher 支持) - #83
Merged
std-microblock merged 1 commit intoOct 8, 2026
Conversation
Linux AppImages shipped without update information, so AppImageUpdate, AppImageLauncher and friends could not perform delta updates (issue std-microblock#78). linuxdeploy-plugin-appimage passes $UPDATE_INFORMATION to appimagetool -u, which embeds the string into the .upd_info ELF section and generates the .zsync file. Wire that up in the release and nightly builds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为 Linux AppImage 加上 AppImage 的「更新信息(update information)」并随 release 发布
.zsync,让 AppImageUpdate / AppImageLauncher / AppManager 等工具能够做增量更新(只下载 diff)。Fixes #78。现状与根因
std-microblock/CeleMod的 release 里只有CeleMod_x.y.z_amd64.AppImage,没有.zsync;AppImage 的.upd_infoELF 段也是空的,所以 AppImageUpdate 之类的工具认不出更新源(issue Linux: Embed AppImage update information #78)。-u:tauri-bundler(crates/tauri-bundler/src/bundle/linux/appimage/linuxdeploy.rs:172)只是把 AppDir 交给 linuxdeploy,Bundle > Linux > AppImage也没有对应配置项。linuxdeploy-plugin-appimage的src/main.cpp:138会依次读LDAI_UPDATE_INFORMATION/UPDATE_INFORMATION/LDAI_UPD_INFO/UPD_INFO,并转成appimagetool -u <值>;appimagetool 收到后会把字符串写进 ELF 的.upd_info段(appimagetool/src/appimagetool.c:1033-1075),并调用zsyncmake生成同名.zsync(src/appimagetool.c:1133-1155)。所以不用改打包器,只要在 CI 里设置好这个变量 + 装zsync。zsyncmake生成的文件落在当前工作目录(<AppImage 文件名>.zsync),不是 AppImage 旁边。而 tauri-cli 在build的setup()里会set_current_dir(dirs.tauri)(crates/tauri-cli/src/build.rs:166,即src-tauri/),所以 CI 里这个文件会出现在src-tauri/CeleMod_x.y.z_amd64.AppImage.zsync,需要收进target/release/bundle/appimage/才能作为产物/资产上传。改动
.github/workflows/Build.ymlLinux 依赖加
zsync(提供zsyncmake,appimagetool 靠它生成.zsync)。新增
Configure AppImage delta updates:tag 构建写入 channellatest,master 构建写入 channelnightly,PR 构建不写(产物不带更新信息):新增
Collect AppImage delta update file:把.zsync收进target/release/bundle/appimage/(find -maxdepth 2覆盖上面说的src-tauri/和万一回到仓库根目录两种情况);如果一个都没生成就直接::error::失败,避免 release 里 AppImage 带更新信息却没有对应.zsync。新增
Upload AppImage delta update file:.zsync作为构建产物上传(nightly 走这条)。新增
Upload AppImage delta update to release:tag 发布时用gh release upload ... --clobber把.zsync传到 release(tauri-action 的产物白名单里没有.zsync,不会替我们传;用gh release upload而不是 action-gh-release 是为了不动 release 标题/正文,并保证重跑幂等)。scripts/publish-nightly.cjs/scripts/publish-nightly.test.cjs.AppImage.zsync:缺失时和缺平台产物一样拒绝覆盖旧 release(否则带 nightly 更新信息的 AppImage 会指向一个不存在的资产)。测试 fixture 补上该文件,并新增一个「缺.zsync不发布」用例。macOS / Windows / PR 构建行为不变。
验证
用 CI 里同一套工具(tauri 从
tauri-apps/binary-releases下载的linuxdeploy-07333c6、linuxdeploy-plugin-appimagecontinuous,以及appimagetool)在本地按 Build.yml 里新增的两段脚本原样跑了一遍(tag 与 master 各一次),并用同一个 AppDir 跑了不带UPDATE_INFORMATION的对照:.upd_info.zsyncGITHUB_REF=refs/tags/v1.2.1(channellatest)gh-releases-zsync|std-microblock|CeleMod|latest|CeleMod_*_amd64.AppImage.zsyncFilename/SHA-1与 AppImage 一致GITHUB_REF=refs/heads/master(channelnightly)gh-releases-zsync|std-microblock|CeleMod|nightly|CeleMod_*_amd64.AppImage.zsyncFilename/SHA-1与 AppImage 一致UPDATE_INFORMATION(对照 / PR 构建)另外校验了更新信息里的文件名模式能被 AppImageUpdate 的匹配方式(
fnmatch,见 AppImageUpdateGithubReleasesZsyncUpdateInformation.cpp)命中 release 资产名:仓库内检查:
node --test scripts/publish-nightly.test.cjs→ 9/9 通过cd src-tauri && cargo test --lib→ 105/105 通过(本次未改 Rust 代码).github/workflows/Build.yml→ 无问题;YAML 可正常解析补充说明:channel 用 tag 名是 AppImageUpdate 支持的写法(
latest走/releases/latest,其它值走/releases/tags/<tag>),所以 nightly 版 AppImage 更新到 nightly release、正式版更新到 latest release;AppImage 内部嵌的是相对文件名,AppImageUpdate 会以.zsync的下载地址为基准解析到同 release 里的 AppImage。