From cd1ef98b2758d6c84fa77d9bc1518b6bf7c17a80 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Tue, 8 Sep 2026 12:33:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20checkout=20=E6=B5=85=E5=85=8B?= =?UTF-8?q?=E9=9A=86=20+=20sing-box=20clone=20=E9=87=8D=E8=AF=95(=E5=A4=96?= =?UTF-8?q?=E7=BD=91=E8=B5=B0=20frps=20=E7=A8=B3=E5=AE=9A=E6=80=A7=20A)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 外网 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 Claude-Session: https://claude.ai/code/session_01FEVUXAbFT6bF1Qw27RHWoD --- .gitea/workflows/deploy-client.yml | 24 ++++++++++++++++++++++++ scripts/build-libbox.sh | 9 ++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy-client.yml b/.gitea/workflows/deploy-client.yml index 641d9b1..cfe5e32 100644 --- a/.gitea/workflows/deploy-client.yml +++ b/.gitea/workflows/deploy-client.yml @@ -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)。 diff --git a/scripts/build-libbox.sh b/scripts/build-libbox.sh index 1803071..42e8dd6 100644 --- a/scripts/build-libbox.sh +++ b/scripts/build-libbox.sh @@ -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 编核心库"