@@ -9,6 +9,10 @@ FLUTTER_OS=$(echo "${OS}" | awk '{print tolower($0)}')
9
9
FLUTTER_ARCH=$( echo " ${ARCH} " | awk ' {print tolower($0)}' )
10
10
FLUTTER_RELEASE_URL=${FLUTTER_RELEASE_URL:- " https://storage.googleapis.com/flutter_infra_release/releases" }
11
11
12
+ # WARNING:
13
+ # Setting the Flutter SDK version to "latest" will automatically determine the latest Flutter SDK version via the release manifest.
14
+ # But it will break the caching mechanism, and the action will download the Flutter SDK on every run.
15
+
12
16
# Automatically determine the latest Flutter SDK version via the release manifest
13
17
if [[ $FLUTTER_VERSION == " latest" ]]; then
14
18
# Flutter SDK release manifest
76
80
# /stable /windows/ flutter_windows_3.0.2-stable.zip
77
81
# /beta /windows/ flutter_windows_3.1.0-9.0.pre-beta.zip
78
82
FLUTTER_BUILD_ARTIFACT_ID=" flutter_${FLUTTER_BUILD_OS} _${FLUTTER_VERSION} -${FLUTTER_CHANNEL} .${EXT} "
79
- FLUTTER_BUILD_ARTIFACT_URL=${FLUTTER_BUILD_ARTIFACT_URL :- " ${FLUTTER_RELEASE_URL} /${FLUTTER_CHANNEL} /${FLUTTER_OS} /${FLUTTER_BUILD_ARTIFACT_ID} " }
83
+ FLUTTER_BUILD_ARTIFACT_URL=" ${FLUTTER_RELEASE_URL} /${FLUTTER_CHANNEL} /${FLUTTER_OS} /${FLUTTER_BUILD_ARTIFACT_ID} "
80
84
81
85
# Flutter runner tool cache and pub cache
82
- # Ref: https://github.com/flutter-actions/setup-flutter/pull/11
83
- # FLUTTER_RUNNER_TOOL_CACHE=${{ runner.tool_cache }}/flutter-${{ runner.os }}-${{ inputs.version }}-${{ runner.arch }}-${{ inputs.channel }}
84
- # FLUTTER_PUB_CACHE=${{ runner.temp }}/pub-cache
85
- FLUTTER_RUNNER_TOOL_CACHE=" ${RUNNER_TOOL_CACHE} /flutter/${FLUTTER_BUILD_ARTIFACT_ID} "
86
+ # Thanks to @alijvhr for providing a fix, https://github.com/flutter-actions/setup-flutter/pull/11
87
+ FLUTTER_RUNNER_TOOL_CACHE=" ${RUNNER_TOOL_CACHE} /flutter/${FLUTTER_VERSION} /${FLUTTER_CHANNEL} "
86
88
FLUTTER_PUB_CACHE=" ${RUNNER_TEMP} /flutter/pub-cache"
87
89
88
90
# Check if Flutter SDK already exists, otherwise download and install
@@ -118,7 +120,7 @@ if [ ! -d "${FLUTTER_RUNNER_TOOL_CACHE}" ]; then
118
120
exit 1
119
121
fi
120
122
else
121
- echo " Cache restored Flutter SDK version: ${FLUTTER_VERSION} (${FLUTTER_CHANNEL} ) on \" ${FLUTTER_OS} _${ARCH} \" "
123
+ echo " Flutter SDK version restored from cache : ${FLUTTER_VERSION} (${FLUTTER_CHANNEL} ) on \" ${FLUTTER_OS} _${ARCH} \" "
122
124
fi
123
125
124
126
# Configure pub to use a fixed location.
0 commit comments