fix(ci): checkout 浅克隆 + sing-box clone 重试(外网走 frps 稳定性 A)

外网 runner 的 git fetch 经 ali frps 隧道偶发超时(run#289/290 的 Checkout
卡死即此)。A 层加固:
- deploy-client.yml 全部 actions/checkout 加 fetch-depth:1 —— 从拉全历史
  降到一层,数据骤减,直接打掉 Checkout 步超时根因(外网/在家都受益)。
- build-libbox.sh sing-box clone(已 --depth 1)加 3 次重试 —— 另一大 fetch
  抖了自动重来。
checkout 步显式重试(需替换 actions/checkout)暂缓,先看浅克隆后失败率;
仍高再上 checkout 重试 + frps 隧道调优(B)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEVUXAbFT6bF1Qw27RHWoD
This commit is contained in:
wangjia
2026-09-08 12:33:17 +08:00
parent 6a3cb48a02
commit cd1ef98b27
2 changed files with 32 additions and 1 deletions
+8 -1
View File
@@ -57,7 +57,14 @@ rm -rf "$WORK/sing-box"
# sing-box 源码:默认 github,CI 里国内 runner 连不上 github → 经 SINGBOX_GIT 指向
# NAS gitea 镜像(wangjia/sing-box,gitea migrate 自 github)。见 deploy-client.yml。
SINGBOX_GIT="${SINGBOX_GIT:-https://github.com/SagerNet/sing-box.git}"
git clone --depth 1 --branch "$SINGBOX_VERSION" "$SINGBOX_GIT" "$WORK/sing-box"
# 已是 --depth 1 浅克隆;外网 runner 经 ali frps 隧道 clone 偶发超时 → 重试 3 次。
_sb_ok=
for _try in 1 2 3; do
rm -rf "$WORK/sing-box"
if git clone --depth 1 --branch "$SINGBOX_VERSION" "$SINGBOX_GIT" "$WORK/sing-box"; then _sb_ok=1; break; fi
echo " sing-box clone 第 $_try 次失败(frps 抖动?),12s 后重试..."; sleep 12
done
[ -n "$_sb_ok" ] || { echo "✗ sing-box clone 重试耗尽($SINGBOX_GIT)"; exit 1; }
cd "$WORK/sing-box"
echo "==> [3/3] 用官方 build_libbox 编核心库"