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
+24
View File
@@ -40,6 +40,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# 浅克隆:走 ali frps 隧道时数据量从全历史降到一层,大幅降低 Checkout 超时率
# (外网/在家都受益;根治外网稳定见 fetch 重试 + frps 调优)。
fetch-depth: 1
- name: Compile (Android APK)
env:
@@ -71,6 +75,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# 浅克隆:走 ali frps 隧道时数据量从全历史降到一层,大幅降低 Checkout 超时率
# (外网/在家都受益;根治外网稳定见 fetch 重试 + frps 调优)。
fetch-depth: 1
- name: Compile (Windows installer)
shell: bash
@@ -113,6 +121,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# 浅克隆:走 ali frps 隧道时数据量从全历史降到一层,大幅降低 Checkout 超时率
# (外网/在家都受益;根治外网稳定见 fetch 重试 + frps 调优)。
fetch-depth: 1
# 多账号切换(见 docs/ci-multi-account-signing-design.html):从 signing.env
# 单源读 SIGNING_ACCOUNT(us|cn),下方按它选账号的证书/ASC 密钥集。
@@ -158,6 +170,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# 浅克隆:走 ali frps 隧道时数据量从全历史降到一层,大幅降低 Checkout 超时率
# (外网/在家都受益;根治外网稳定见 fetch 重试 + frps 调优)。
fetch-depth: 1
- name: Resolve signing account
id: acct
@@ -191,6 +207,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# 浅克隆:走 ali frps 隧道时数据量从全历史降到一层,大幅降低 Checkout 超时率
# (外网/在家都受益;根治外网稳定见 fetch 重试 + frps 调优)。
fetch-depth: 1
- name: Compile (Astro 官网)
env:
SITE_URL: https://pangolin.yanmeiai.com
@@ -226,6 +246,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# 浅克隆:走 ali frps 隧道时数据量从全历史降到一层,大幅降低 Checkout 超时率
# (外网/在家都受益;根治外网稳定见 fetch 重试 + frps 调优)。
fetch-depth: 1
# 一次性下所有 artifact(不带 name),避免同 job 内两次复用 download-artifact
# action → act 对其只读缓存 git 仓库做二次操作时 EACCES(pack idx 444)。
+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 编核心库"