From 91fc5093d1b5bb7c0009c5b1654fc833cc4e91da Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Tue, 29 Sep 2026 14:19:29 +0800 Subject: [PATCH] =?UTF-8?q?ci(release):=20=E9=AA=8C=E8=AF=81=E4=BA=A7?= =?UTF-8?q?=E7=89=A9=E6=94=B9=E7=94=A8=20>/dev/null=20=E8=80=8C=E9=9D=9E?= =?UTF-8?q?=20grep=20-q=20=E2=80=94=E2=80=94=20SIGPIPE=20=E8=AF=AF?= =?UTF-8?q?=E6=9D=80=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 问题(第二次试发布实测) 打包成功后,「验证产物」步骤失败: tar: stdout: write error dpkg-deb: error: tar subprocess returned error exit status 2 而三个 deb 的元数据其实已全部正确打印(Package/Version/Architecture)。 ## 根因 `dpkg-deb -c <800M 的 full 包> | grep -q <模型文件>`: grep -q 匹配到目标行后**立即退出**、关闭管道读端 ⇒ dpkg-deb 内部的 tar 继续写 stdout 时收到 EPIPE ⇒ pipefail 判整条 pipeline 失败。 ⇒ 检测项本身是好的(模型确实在包里),却被检测手段误杀。 本地用 CI 上同一个 800M full 包复现: grep -q 版 → dpkg-deb: error: tar subprocess was killed by signal (Broken pipe) >/dev/null 版 → 通过 client(80M)没炸、full(800M)炸 —— 包越大越容易触发(内容越多, grep -q 提前退出的窗口越大)。这正是它没在本地小规模测试里暴露的原因。 ## 改法 检测存在性时用 `grep >/dev/null`(读完整个输入再退出), 不用 `grep -q`。顺带补了 server 包的模型在位检测(原来只测了 full)。 --- .github/workflows/release.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7bcbf5..2b891ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -243,13 +243,22 @@ jobs: echo " $f" dpkg-deb -f "$f" Package Version Architecture | sed 's/^/ /' done - # full/server 必须真的带模型,否则是"默认启用但装完不能用"的假包 + # full/server 必须真的带模型,否则是“默认启用但装完不能用”的假包。 + # + # ★ 不能用 grep -q:它匹配到就退出,关闭管道读端,dpkg-deb 内部 + # 的 tar 写 stdout 时收到 EPIPE(“stdout: write error”), + # 在 pipefail 下整条 pipeline 变成失败 —— 检测项本身是好的, + # 却被检测手段误杀(首次试发布就死在这里)。改用 >/dev/null, + # grep 会读完整个输入再退出,不产生 SIGPIPE。 dpkg-deb -c homeagent-full_*_amd64.deb \ - | grep -q "chinese-clip-vit-b16-onnx/TextEncoder.onnx" + | grep "chinese-clip-vit-b16-onnx/TextEncoder.onnx" >/dev/null echo " ✓ full 包含模型" dpkg-deb -c homeagent-full_*_amd64.deb \ - | grep -q "libonnxruntime.so" + | grep "libonnxruntime.so" >/dev/null echo " ✓ full 包含 ONNX Runtime" + dpkg-deb -c homeagent-server_*_amd64.deb \ + | grep "chinese-clip-vit-b16-onnx/TextEncoder.onnx" >/dev/null + echo " ✓ server 包含模型" sha256sum -c SHA256SUMS - uses: actions/upload-artifact@v7