Skip to content

ci: add daily build workflow with auto cleanup - #137

Open
1368129224 wants to merge 2 commits into
VirtualHotBar:mainfrom
1368129224:daily-build-pr
Open

1368129224 wants to merge 2 commits into
VirtualHotBar:mainfrom
1368129224:daily-build-pr

Conversation

@1368129224

Copy link
Copy Markdown

Summary

Adds a new daily build workflow that automatically creates development builds for all 6 target platforms every day.

What this workflow does

  • Runs daily at 2:00 UTC (or manually via workflow_dispatch)
  • Builds Tauri app for 6 platforms: Linux/macOS/Windows × x86_64/aarch64
  • Creates a prerelease with tag daily-v{version}-{short_sha}
  • Uploads portable ZIP for Windows targets
  • Auto-cleans old daily releases, keeping only the latest 5

Artifacts

Platform Arch Formats
Linux x86_64, arm64 .deb, .rpm, .AppImage
macOS x86_64, arm64 .dmg, .app.tar.gz
Windows x86_64, arm64 .exe (NSIS installer), portable .zip

Requirements

No new secrets needed — uses the same TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD already configured for main.yml.

@1368129224
1368129224 force-pushed the daily-build-pr branch 3 times, most recently from d9e1e54 to 6e5c970 Compare July 7, 2026 08:20
@VirtualHotBar

Copy link
Copy Markdown
Owner

Request changes

发现两个需要在合并前修复的问题:

  1. Windows portable ZIP 缺少运行时依赖

.github/workflows/daily-build.yml:226-237 只将 NetMount.exe 和 .portable 打包进 ZIP。但 src-tauri/tauri.conf.json:16 配置了 binaries/**/* 资源,程序还会在 src-tauri/src/lib.rs:545-553 和 :788-799 运行时查找 binaries/<sidecar>-<target>。

因此当前 portable ZIP 很可能可以启动,但在使用 rclone 或 openlist 时会因 sidecar 缺失而失败。请将所需 sidecar 及便携模式需要的其他运行资源一并打包,并增加解压后运行的 smoke test。

  1. 矩阵任务并发操作同一个 Release

.github/workflows/daily-build.yml:189-205 中所有矩阵任务都使用相同的 tagName,并由 tauri-apps/tauri-action@v0 创建或更新 Release。多个任务可能同时竞争创建同一个 Release,或者并发上传/更新 latest.json。如果某个平台构建失败,还可能留下只有部分平台资源的公开 prerelease。

现有 .github/workflows/main.yml 已经采用更可靠的流程:先单独创建 draft Release,再将 releaseId 传给矩阵任务,最后在所有构建成功后发布。Daily build 建议复用这一模式。

另外还有两个需要确认的点:

  • windows-11-arm runner label 在本地 actionlint 中被报告为未知,需要确认 GitHub Actions 当前是否支持该 label。
  • RCLONE_VERSION: "current" 会使缓存 key 长期不变,可能导致 daily build 持续使用旧版 rclone。
  • 清理逻辑只查询最近 100 个 Release,且删除 Release 时没有使用 --cleanup-tag,可能留下旧 Release 或孤立 tag。

本地 YAML 解析、TypeScript 类型检查和 ESLint 均通过;由于无法在本地执行 GitHub Actions 矩阵,以上 workflow 行为仍需要在 GitHub 环境中验证。

zengzhichao233 and others added 2 commits September 4, 2026 09:20
…ndition

- Package sidecar binaries (rclone/openlist) and winfsp.msi into the
  Windows portable ZIP alongside NetMount.exe, matching the binaries/
  resource layout the app looks up at runtime via resolve_resource
  (Windows resource_dir == exe dir). Add a post-extract smoke test that
  fails the build if the exe, .portable marker, or sidecars are missing.
- Split the daily-build release flow into create-release (single draft
  prerelease) -> build (uploads via releaseId) -> publish-release
  (undrafts only after all matrix legs succeed), removing the race where
  every matrix job created/updated the same tagged Release concurrently
  and could leave a public prerelease with only partial platform assets.
- Resolve the actual current rclone version from
  downloads.rclone.org/version.txt and use it in the binaries cache key
  instead of the static literal "current", so the daily build picks up
  new rclone releases instead of reusing a stale cached binary forever.
- Widen release cleanup to fetch up to 1000 releases, only prunes
  published (non-draft) daily prereleases, and pass --cleanup-tag when
  deleting so orphaned tags aren't left behind.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@1368129224

Copy link
Copy Markdown
Author

已根据反馈修复,新增 commit af6c19e:

1. Windows 便携 ZIP 缺运行时依赖
Create Windows portable ZIP 步骤现在会把 src-tauri/binaries 下与当前 target 匹配的 sidecar(rclone-<target>.exe、openlist-<target>.exe)以及 winfsp.msi 一并打包进 binaries/ 子目录,与 tauri.conf.json 的 resources: ["binaries/**/*"] 配置及 Windows 上 resolve_resource 以 exe 所在目录为基准的行为保持一致。同时新增了解压后的 smoke test:校验 NetMount.exe、.portable 标记、binaries/ 下的 sidecar 是否齐全,任一缺失就会让构建失败,而不是静默产出一个残缺的便携包。

2. 矩阵任务并发操作同一 Release
复用 main.yml 已有的模式:拆分为 create-release(单独创建一次 draft prerelease)→ build(矩阵任务通过 releaseId 上传产物,不再各自创建/更新 Release)→ publish-release(所有矩阵任务成功后才统一取消 draft)。这样即使某个平台构建失败,也只会留下 draft(不公开),不会出现只有部分平台资源的公开 prerelease。

确认点:

  • windows-11-arm:用最新版 actionlint(v1.7.12)本地验证通过,且已在 GitHub 环境中实际运行成功,该 label 目前可用。
  • RCLONE_VERSION: "current":改为在 prepare job 中实时请求 downloads.rclone.org/version.txt 解析真实版本号(如 v1.75.0)作为缓存 key 的一部分,避免长期复用旧版 rclone 缓存。
  • 清理逻辑:--limit 提到 1000,只清理已发布(非 draft)的 daily prerelease,删除时加 --cleanup-tag 避免孤立 tag。

验证: 已在 fork 上手动触发并跑通完整流程(run 33827694009),6 个平台全部构建成功,Release 已从 draft 正确发布为 prerelease,资源包含全部 14 个产物(含两个便携 ZIP)。Windows 便携包 smoke test 输出确认 binaries/openlist-*.exe、binaries/rclone-*.exe、binaries/winfsp.msi 均已打包进 ZIP。

请复查,谢谢!

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

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.

3 participants