Skip to content

Commit b473172

Browse files
authored
fix: installs failing on arm architecture (#35)
* fix: installs failing on arm
1 parent 8bec469 commit b473172

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

.circleci/test-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
integration-test-macos:
1111
macos:
1212
xcode: 14.2.0
13+
resource_class: macos.m1.large.gen1
1314
steps:
1415
- checkout
1516
- flutter/install_sdk_and_pub:

src/scripts/install-sdk.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
INSTALL_LOCATION=$(eval "echo $ORB_EVAL_INSTALL_LOCATION")
44

5-
if [ ! -d "$INSTALL_LOCATION/flutter" ]; then
6-
mkdir -p "$INSTALL_LOCATION"
7-
if [ "$(uname)" == 'Darwin' ]; then
8-
curl -o flutter_sdk.zip https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_$ORB_VAL_FLUTTER_SDK_VERSION-stable.zip
9-
unzip -qq flutter_sdk.zip -d "$INSTALL_LOCATION"
10-
rm flutter_sdk.zip
11-
elif uname -a | grep -q "Linux" ; then
12-
curl -o flutter_sdk.tar.xz https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_$ORB_VAL_FLUTTER_SDK_VERSION-stable.tar.xz
13-
tar xf flutter_sdk.tar.xz -C "$INSTALL_LOCATION"
14-
rm -f flutter_sdk.tar.xz
15-
else
16-
echo "This platform ($(uname -a)) is not supported."
17-
exit 1
18-
fi
19-
fi
5+
function install_flutter() {
6+
local machine=${1:-"Linux"}
7+
local arch=${2:-"amd64"}
8+
[[ $machine == "Darwin" ]] && uname=macos || uname=linux
9+
[[ $arch == "arm64" ]] && version="flutter_${uname}_arm64" || version="flutter_${uname}"
10+
[[ $uname == "linux" ]] && suffix="tar.xz" || suffix="zip"
11+
12+
baseurl="https://storage.googleapis.com/flutter_infra_release/releases/stable"
13+
14+
fullurl="$baseurl/$uname/${version}_$ORB_VAL_FLUTTER_SK_VERSION-stable.${suffix}"
15+
16+
curl -o "flutter_sdk.${suffix}" "$fullurl"
17+
}
18+
19+
install_flutter "$(uname)" "$(uname -a)"
2020

2121
echo "export PATH=$INSTALL_LOCATION/flutter/bin:\$PATH" >> "$BASH_ENV"
2222

0 commit comments

Comments
 (0)