fix(ci): iOS Flutter download adds GitHub mirror fallback
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:
1 parent
ffd877430d
commit
0d0da4ca62
1 file changed
+6
-1
@@ -237,8 +237,13 @@ jobs:
|
||||
- name: Setup Flutter
|
||||
run: |
|
||||
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
|
||||
fi
|
||||
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter --version
|
||||
|
||||
Reference in new issue
Block a user