fix(ci): iOS Flutter download adds GitHub mirror fallback
CI / Lint (pull_request) Canceled after 1m28s
CI / Test (pull_request) Canceled after 0s
CI / Build Android (pull_request) Canceled after 0s
CI / Build iOS (pull_request) Canceled after 0s

The macOS runner cannot reach Google Cloud storage. Add a fallback
to the GitHub Flutter releases mirror with a 10s connect timeout
so the build doesn't hang indefinitely.
This commit is contained in:
robot committed 2026-08-04 02:39:27 +00:00
1 parent ffd877430d
commit 0d0da4ca62
1 file changed
+6 -1
+6 -1
View File
@@ -237,8 +237,13 @@ jobs:
- name: Setup Flutter - name: Setup Flutter
run: | run: |
set -e set -e
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_${{ env.FLUTTER_VERSION }}-stable.tar.xz" \ # Try Google storage, fallback to GitHub mirror
if ! curl -fsSL --connect-timeout 10 "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_${{ env.FLUTTER_VERSION }}-stable.tar.xz" \
-o /tmp/flutter.tar.xz 2>/dev/null; then
echo "Google storage unavailable, trying GitHub mirror..."
curl -fsSL "https://github.com/flutter/flutter/releases/download/${{ env.FLUTTER_VERSION }}-stable/flutter_macos_${{ env.FLUTTER_VERSION }}-stable.tar.xz" \
-o /tmp/flutter.tar.xz -o /tmp/flutter.tar.xz
fi
tar -xf /tmp/flutter.tar.xz -C "$PWD" tar -xf /tmp/flutter.tar.xz -C "$PWD"
export PATH="$PWD/flutter/bin:$PATH" export PATH="$PWD/flutter/bin:$PATH"
flutter --version flutter --version