11ca7531a3
Deploy Client / build-android (push) Successful in 1m46s
Deploy Client / build-windows (push) Successful in 1m55s
Deploy Client / build-macos (push) Successful in 3m40s
Deploy Client / build-ios (push) Successful in 3m28s
Deploy Client / release-deploy (push) Successful in 2m14s
iOS build 曾因 flutter build 内隐式 pub get 拉 google_fonts 时 pub.flutter-io.cn socket error(exit 69)而失败。_env.sh 加 flutter_pub_get_retry(5 次重试),四个 compile 脚本在 flutter build 前显式预取,成功后 build 命中缓存不再拉网,减少偶发 网络失败。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
47 lines
1.8 KiB
Bash
Executable File
47 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# _env.sh — shared CI mirror env + tag-version helper. `source` this from other
|
|
# scripts; do not execute directly. Idempotent: only sets vars if not already
|
|
# provided by the environment (e.g. workflow-level overrides).
|
|
|
|
export GOPROXY="${GOPROXY:-https://goproxy.cn,direct}"
|
|
export PUB_HOSTED_URL="${PUB_HOSTED_URL:-https://pub.flutter-io.cn}"
|
|
export FLUTTER_STORAGE_BASE_URL="${FLUTTER_STORAGE_BASE_URL:-https://storage.flutter-io.cn}"
|
|
|
|
# Forgejo/Gitea repo coordinates (used by lib-forgejo.sh). Secrets
|
|
# FORGEJO_TOKEN / FORGEJO_URL are injected by the CI runner, not set here.
|
|
export FORGEJO_REPO="${FORGEJO_REPO:-wangjia/pangolin}"
|
|
|
|
# Ensure Homebrew tools are on PATH (macOS runners); harmless elsewhere.
|
|
case ":${PATH}:" in
|
|
*":/opt/homebrew/bin:"*) ;;
|
|
*) export PATH="/opt/homebrew/bin:${PATH}" ;;
|
|
esac
|
|
|
|
# ver_from_tag <prefix> <ref>
|
|
# Strips an optional "refs/tags/" prefix, then the "<prefix>-v" prefix,
|
|
# leaving a bare semver. Uses parameter expansion only (no command
|
|
# substitution). Examples:
|
|
# ver_from_tag server server-v1.2.3 -> 1.2.3
|
|
# ver_from_tag server refs/tags/server-v1.2.3 -> 1.2.3
|
|
ver_from_tag() {
|
|
local prefix="$1" ref="$2"
|
|
ref="${ref#refs/tags/}"
|
|
ref="${ref#"${prefix}"-v}"
|
|
printf '%s' "$ref"
|
|
}
|
|
|
|
# flutter_pub_get_retry — pub.flutter-io.cn 常被 GFW 抖断(socket error / exit 69),
|
|
# 让 flutter build 内隐式的 pub get 偶发失败(见 iOS build 曾因 google_fonts 拉包
|
|
# 断线而挂)。构建前显式预取 + 重试;成功后 build 命中缓存不再拉网。在 flutter
|
|
# 项目根目录调用。
|
|
flutter_pub_get_retry() {
|
|
local i
|
|
for i in 1 2 3 4 5; do
|
|
if flutter pub get; then return 0; fi
|
|
echo "==> flutter pub get 失败(第 ${i}/5 次,pub.flutter-io.cn 抖?),8s 后重试..." >&2
|
|
sleep 8
|
|
done
|
|
echo "==> flutter pub get 5 次仍失败,放弃" >&2
|
|
return 1
|
|
}
|