File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,18 @@ FLUTTER_OS=$OS
12
12
# Detect the latest version
13
13
if [[ $FLUTTER_VERSION == " latest" ]]
14
14
then
15
+ FLUTTER_RELEASE_MANIFEST_URL=" https://storage.googleapis.com/flutter_infra_release/releases/releases_$OS .json"
16
+ FLUTTER_RELEASE_MANIFEST_FILE=" ${RUNNER_TEMP} /flutter_release.json"
15
17
echo " Detecting latest version..."
16
- curl -L https://storage.googleapis.com/flutter_infra_release/releases/releases_$OS .json -o " ${RUNNER_TEMP} /flutter_release.json"
17
- CURRENT_RELEASE=$( jq -r " .current_release.${FLUTTER_CHANNEL} " " ${RUNNER_TEMP} /flutter_release.json" )
18
- FLUTTER_VERSION=$( jq -r " .releases | map(select(.hash == \" ${CURRENT_RELEASE} \" )) | .[0].version" " ${RUNNER_TEMP} /flutter_release.json" )
19
- rm " ${RUNNER_TEMP} /flutter_release.json"
18
+ if curl -fsSL " $FLUTTER_RELEASE_MANIFEST_URL " -o " $FLUTTER_RELEASE_MANIFEST_FILE " ;
19
+ then
20
+ CURRENT_RELEASE=$( jq -r " .current_release.${FLUTTER_CHANNEL} " " $FLUTTER_RELEASE_MANIFEST_FILE " )
21
+ FLUTTER_VERSION=$( jq -r " .releases | map(select(.hash == \" ${CURRENT_RELEASE} \" )) | .[0].version" " $FLUTTER_RELEASE_MANIFEST_FILE " )
22
+ rm " $FLUTTER_RELEASE_MANIFEST_FILE "
23
+ else
24
+ echo -e " ::error::Failed to detect the latest version."
25
+ exit 1
26
+ fi
20
27
fi
21
28
22
29
# Apple Intel or Apple Silicon
You can’t perform that action at this time.
0 commit comments