Skip to content

Commit 18f8be5

Browse files
committed
fix(ci): 释放 Linux release job 磁盘空间避免 musl CLI 构建 ENOSPC
Linux job 在同一磁盘先后产出 release-lto(GUI/AppImage/deb/rpm/arch)与 release-cli(musl CLI)两份完整 target,叠加 cargo registry / docker / zig 工具链后撑爆磁盘,musl CLI 步骤报 "No space left on device"(run 27593938453)。 - job 开头删除无关预装工具链(Android/.NET/GHC/CodeQL/Swift)腾出 ~25GB - musl 构建前删 target/release-lto(产物已上传 artifact,musl 走独立 release-cli profile)
1 parent 8707838 commit 18f8be5

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/zap_release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,18 @@ jobs:
296296
with:
297297
ref: ${{ needs.prepare_metadata.outputs.release_branch }}
298298

299+
# GitHub-hosted ubuntu runner 的 / 余量有限,而本 job 先后在同一磁盘产出
300+
# release-lto(GUI/AppImage/deb/rpm/arch)与 release-cli(musl CLI)两份完整
301+
# target,叠加 cargo registry / docker 镜像 / zig 工具链后会撑爆磁盘,musl CLI
302+
# 步骤报 "No space left on device"(见 run 27593938453)。先删掉与本构建无关的
303+
# 预装工具链(Android SDK / .NET / GHC / CodeQL / Swift),腾出 ~25GB。
304+
- name: Free up disk space
305+
shell: bash
306+
run: |
307+
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc \
308+
/usr/local/.ghcup /opt/hostedtoolcache/CodeQL /usr/share/swift || true
309+
df -h /
310+
299311
- uses: ./.github/actions/prepare_environment
300312
with:
301313
target_os: linux
@@ -427,6 +439,15 @@ jobs:
427439
if-no-files-found: error
428440
retention-days: 7
429441

442+
# release-lto 产物(GUI/deb/rpm/arch)已由上一步 "Upload package artifacts"
443+
# 上传为 workflow artifact,本地不再需要;下面的 musl CLI 走独立的 release-cli
444+
# profile,删掉 release-lto 给它腾磁盘,避免 "No space left on device"。
445+
- name: Reclaim disk before musl CLI build
446+
shell: bash
447+
run: |
448+
rm -rf target/release-lto
449+
df -h /
450+
430451
# CLI/remote-server tarball 用静态 musl 链接,产物不依赖宿主 glibc,
431452
# 可在任意 Linux x86_64 主机(含 CentOS 7 / Amazon Linux 2 等旧 glibc
432453
# 以及 Alpine 等 musl 发行版)上运行。GUI AppImage/deb 仍走上面的

0 commit comments

Comments
 (0)