ci(deploy-client): iOS 上传加超时看门狗 + iOS 失败不阻断发版
Deploy Client / build-windows (push) Successful in 3m58s
Deploy Client / build-client-web (push) Successful in 6m17s
Deploy Client / build-macos (push) Successful in 13m39s
Deploy Client / build-android (push) Successful in 7m17s
Deploy Client / build-ios (push) Successful in 6m42s
Deploy Client / release-deploy-client (push) Successful in 11m50s
Deploy Client / build-windows (push) Successful in 3m58s
Deploy Client / build-client-web (push) Successful in 6m17s
Deploy Client / build-macos (push) Successful in 13m39s
Deploy Client / build-android (push) Successful in 7m17s
Deploy Client / build-ios (push) Successful in 6m42s
Deploy Client / release-deploy-client (push) Successful in 11m50s
1.1.13 发版事故复盘:build-ios 的 altool 上传静默卡死数分钟无输出,超 runner 僵尸超时被 SIGKILL 判失败(软失败 else 分支没机会跑);且 build-ios 被 release-deploy 硬 needs → 连带 web/mac/win/android 整体没部署。 - compile-ios.sh: altool 上传套后台看门狗(本机无 timeout/coreutils),超 420s 先 TERM 再 KILL,保证永远在僵尸窗口内干净收尾,失败只告警不阻断。 - deploy-client.yml: build-ios 加 continue-on-error;release-deploy 改 if: always() 只校验 4 个真实平台成功即部署,iOS 真正不阻塞。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bupi8Kdqkfx2N5acFsHTx5
This commit is contained in:
@@ -98,6 +98,9 @@ jobs:
|
|||||||
build-ios:
|
build-ios:
|
||||||
needs: build-android
|
needs: build-android
|
||||||
runs-on: mac
|
runs-on: mac
|
||||||
|
# iOS TestFlight 上传易抖/易卡,按 CLAUDE.md「iOS 不阻塞发版」:本 job 失败
|
||||||
|
# 不拖垮整个 run,更不阻断下面的 release-deploy(它已改为只校验 4 个真实平台)。
|
||||||
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
PUB_HOSTED_URL: https://pub.flutter-io.cn
|
PUB_HOSTED_URL: https://pub.flutter-io.cn
|
||||||
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
|
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
|
||||||
@@ -159,6 +162,14 @@ jobs:
|
|||||||
|
|
||||||
release-deploy-client:
|
release-deploy-client:
|
||||||
needs: [build-client-web, build-macos, build-android, build-ios, build-windows]
|
needs: [build-client-web, build-macos, build-android, build-ios, build-windows]
|
||||||
|
# iOS(build-ios)故意可失败:只要 4 个真实平台成功就照常发布部署。
|
||||||
|
# always() 保证 build-ios 失败时本 job 不被跳过;再逐个校验其余平台必须成功。
|
||||||
|
if: >-
|
||||||
|
${{ always()
|
||||||
|
&& needs.build-client-web.result == 'success'
|
||||||
|
&& needs.build-macos.result == 'success'
|
||||||
|
&& needs.build-android.result == 'success'
|
||||||
|
&& needs.build-windows.result == 'success' }}
|
||||||
runs-on: mac
|
runs-on: mac
|
||||||
env:
|
env:
|
||||||
GOPROXY: https://goproxy.cn,direct
|
GOPROXY: https://goproxy.cn,direct
|
||||||
|
|||||||
@@ -102,11 +102,26 @@ echo "==> compile-ios: built ${IPA}"
|
|||||||
# TestFlight 是 App Store 独立分发渠道,上传本身易抖(重复 build 号 / ASC 临时错误);
|
# TestFlight 是 App Store 独立分发渠道,上传本身易抖(重复 build 号 / ASC 临时错误);
|
||||||
# 其失败【不应阻断】web/mac/win/android 的整体发版(见 CLAUDE.md「iOS ... 不阻塞」)。
|
# 其失败【不应阻断】web/mac/win/android 的整体发版(见 CLAUDE.md「iOS ... 不阻塞」)。
|
||||||
# IPA 已产出,上传失败仅告警,可稍后用 altool/Transporter 手动补传同一 IPA。
|
# IPA 已产出,上传失败仅告警,可稍后用 altool/Transporter 手动补传同一 IPA。
|
||||||
echo "==> compile-ios: uploading to TestFlight"
|
# altool 上传是【静默】的:上传 IPA 到 Apple 期间数分钟无任何输出。网络到 Apple
|
||||||
if xcrun altool --upload-app -f "$IPA" -t ios \
|
# 抖动/变慢时会长时间挂住 → 超过 runner 僵尸超时(10min)整个 job 被 SIGKILL 判
|
||||||
|
# 失败,连下面的软失败分支都跑不到 → 阻断发版(1.1.13 就这么挂的)。
|
||||||
|
# 本机无 timeout(1)/gtimeout(1)(无 coreutils),故用后台看门狗:超 UPLOAD_TIMEOUT
|
||||||
|
# 先 TERM 再 KILL,保证上传永远在僵尸窗口内【干净收尾】,失败只告警不阻断。
|
||||||
|
UPLOAD_TIMEOUT=420
|
||||||
|
echo "==> compile-ios: uploading to TestFlight (超时保护 ${UPLOAD_TIMEOUT}s)"
|
||||||
|
xcrun altool --upload-app -f "$IPA" -t ios \
|
||||||
--apiKey "${KEY_ID}" \
|
--apiKey "${KEY_ID}" \
|
||||||
--apiIssuer "${ISSUER}"; then
|
--apiIssuer "${ISSUER}" &
|
||||||
|
altool_pid=$!
|
||||||
|
( sleep "$UPLOAD_TIMEOUT"
|
||||||
|
kill -TERM "$altool_pid" 2>/dev/null || true
|
||||||
|
sleep 5
|
||||||
|
kill -KILL "$altool_pid" 2>/dev/null || true ) &
|
||||||
|
watchdog_pid=$!
|
||||||
|
if wait "$altool_pid"; then
|
||||||
echo "==> compile-ios: done — uploaded build ${BUILD} to TestFlight"
|
echo "==> compile-ios: done — uploaded build ${BUILD} to TestFlight"
|
||||||
else
|
else
|
||||||
echo "!! compile-ios: TestFlight 上传失败(build ${BUILD}),不阻断发版;IPA=${IPA} 已产出,可稍后手动补传。" >&2
|
echo "!! compile-ios: TestFlight 上传失败或超时(build ${BUILD}),不阻断发版;IPA=${IPA} 已产出,可稍后手动补传。" >&2
|
||||||
fi
|
fi
|
||||||
|
kill "$watchdog_pid" 2>/dev/null || true
|
||||||
|
wait "$watchdog_pid" 2>/dev/null || true
|
||||||
|
|||||||
Reference in New Issue
Block a user