Skip to content

fix(apt): gh-pages 不再存储 .deb,Packages 指向 GitHub Releases - #82

Merged
lloydzhou merged 1 commit into
mainfrom
fix/gh-pages-deb-bloat
Aug 13, 2026
Merged

fix(apt): gh-pages 不再存储 .deb,Packages 指向 GitHub Releases#82
lloydzhou merged 1 commit into
mainfrom
fix/gh-pages-deb-bloat

Conversation

@lloydzhou

Copy link
Copy Markdown
Owner

Problem

每次 release 的 "Build and deploy APT Repository" 步骤把 .deb(amd64 + arm64,各 3-4MB)cpgh-pagesdebian/pool/,然后 commit + push。由于每次版本号不同,旧版本不会被覆盖——成为新的 git blob 永久留在历史中。

实测:gh-pages 历史中 .deb blob 总和 34MB(8 个独立 blob),导致 clone 很慢。

Fix

1. scripts/build-apt-repo.sh — 不再 copy .deb 到 pool/

  • Packages 索引的 Filename: 字段直接写 GitHub Releases 下载 URL:https://github.com/<repo>/releases/download/v<ver>/bash-agent_<ver>_<arch>.deb
  • apt 客户端从该 URL 拉 .deb,完全不经过 gh-pages
  • gh-pages 只保留文本索引文件(Packages.gz / Release,几 KB)
  • 不再创建 pool/ 目录,不再 cp .deb

2. gh-pages 历史清理(已执行)

  • git filter-repo 从 gh-pages 历史中删除 debian/pool/ 下所有 .deb blob
  • 已 force push 到远端 gh-pages

Test plan

  • 本地用 fake .deb 验证 build-apt-repo.shFilename 正确指向 Releases URL,pool/ 不存在,Packages / Release 正常生成
  • gh-pages force push 后 git ls-tree -r origin/gh-pages.deb / pool 条目
  • 下次 release 时 CI 端到端验证 apt install 可用

…eases

每次 release 都往 gh-pages 的 debian/pool/ 提交 .deb blob(~3.5MB x 2),
累积导致 clone 越来越慢(已 34MB 历史 blob)。

改为:Packages 索引的 Filename 字段直接写 GitHub Releases 下载 URL,
apt 客户端从该 URL 拉 .deb,完全不经过 gh-pages。
gh-pages 只保留文本索引文件(Packages.gz / Release,几 KB)。

同时用 git-filter-repo 清理了 gh-pages 历史中已积累的 debian/pool/
下的所有 .deb blob。
@lloydzhou

Copy link
Copy Markdown
Owner Author

审查完成,未发现需要阻塞合并的问题。

  • Filename 使用完整的 Releases 下载地址与 APT 的下载逻辑兼容;APT 将其作为索引源地址拼接时会保留该绝对 URL。
  • 发布工作流会先上传同名 .deb release asset,再生成/发布索引,版本号与资源名均一致。
  • 已确认 gh-pages 当前树不再包含 debian/pool/.deb;现有检查均通过。

建议在下次正式 release 后补跑一次 apt-repo-e2e 工作流,验证真实安装链路。

@lloydzhou
lloydzhou merged commit 0b76c95 into main Aug 13, 2026
32 checks passed
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.

1 participant