工程(ci远端化·修复): mac_setup Godot URL模板修正(双stable+漏v前缀致404)+镜像假zip校验(200错误页体当失败, unzip -tq守卫双处)+chunk_dl.py收编(分片并行断点续传下载器,已实证方案仓库化)
This commit is contained in:
1 parent
f5c3fa935d
commit
fb5f2d42e5
2 files changed
+96
-4
No files matched your search
@@ -15,8 +15,8 @@
|
||||
# 幂等:重复执行只补缺件;账户密码首次生成后存 /var/db/gplan-ci-runner.pw(root 600),重跑复用。
|
||||
set -euo pipefail
|
||||
|
||||
GODOT_VER="4.7.2-stable"
|
||||
GODOT_URL="https://github.com/godotengine/godot/releases/download/${GODOT_VER}/Godot_${GODOT_VER}-stable_macos.universal.zip"
|
||||
GODOT_VER="4.7.2"
|
||||
GODOT_URL="https://github.com/godotengine/godot/releases/download/${GODOT_VER}-stable/Godot_v${GODOT_VER}-stable_macos.universal.zip"
|
||||
GDSTYLE_VER="0.4.0"
|
||||
GDSTYLE_URL="https://github.com/atelico/gdstyle/releases/download/v${GDSTYLE_VER}/gdstyle-x86_64-apple-darwin.tar.gz"
|
||||
MIRRORS=("" "https://gh-proxy.net/" "https://gh-proxy.com/") # 直连优先,镜像回落
|
||||
@@ -94,12 +94,16 @@ else
|
||||
_ok=0
|
||||
for m in "${MIRRORS[@]}"; do
|
||||
log "下载 Godot(${m:+经 $m})"
|
||||
if curl -fL --retry 2 -m 1800 -o "$ZIP" "${m}${GODOT_URL}"; then _ok=1; break; fi
|
||||
# 镜像站可能回 200 的错误页体——下载后必须验 zip 结构,假成功当失败处理
|
||||
if curl -fL --retry 2 -m 1800 -o "$ZIP" "${m}${GODOT_URL}" && unzip -tq "$ZIP" >/dev/null 2>&1; then
|
||||
_ok=1; break
|
||||
fi
|
||||
log "该源失败,换下一源"
|
||||
done
|
||||
[ "$_ok" = 1 ] || die "全部下载源失败——手动下载 ${GODOT_URL} 后重跑并加 --godot-zip <路径>"
|
||||
[ "$_ok" = 1 ] || die "全部下载源失败——手动下载 ${GODOT_URL} 后重跑并加 --godot-zip <路径>;或用 tools/ci/chunk_dl.py 分片拉取"
|
||||
fi
|
||||
TMPD="$(mktemp -d)"
|
||||
unzip -tq "$ZIP" >/dev/null # 双保险:本地复用的 zip 同样验结构
|
||||
unzip -q -o "$ZIP" -d "$TMPD"
|
||||
install -m 0755 "${TMPD}/Godot.app/Contents/MacOS/Godot" /usr/local/bin/godot
|
||||
xattr -dr com.apple.quarantine /usr/local/bin/godot 2>/dev/null || true
|
||||
|
||||
Reference in new issue
Block a user