From ea0f1f770edbb1fa759fbc9474054658685433f6 Mon Sep 17 00:00:00 2001 From: Nicholas Beninato Date: Mon, 9 Jun 2025 14:26:36 -0700 Subject: [PATCH 1/4] use expand_key for PUB_CACHE_PATH --- setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index b9add45..e4b9ef2 100755 --- a/setup.sh +++ b/setup.sh @@ -97,7 +97,7 @@ while getopts 'tc:k:d:l:pa:n:f:g:' flag; do exit 1 fi ;; - g) GIT_SOURCE="$OPTARG" ;; + g) GIT_SOURCE="$OPTARG" ;; ?) exit 2 ;; esac done @@ -180,6 +180,7 @@ expand_key() { CACHE_KEY=$(expand_key "$CACHE_KEY") PUB_CACHE_KEY=$(expand_key "$PUB_CACHE_KEY") CACHE_PATH=$(expand_key "$(transform_path "$CACHE_PATH")") +PUB_CACHE_PATH=$(expand_key "$(transform_path "$PUB_CACHE_PATH")") if [ "$PRINT_ONLY" = true ]; then version_info=$(echo "$VERSION_MANIFEST" | jq -j '.channel,":",.version,":",.dart_sdk_arch // "x64"') From 9179e4aa8fd65927eeb423c4b7f0eb80303539b8 Mon Sep 17 00:00:00 2001 From: Nicholas Beninato Date: Mon, 9 Jun 2025 15:06:40 -0700 Subject: [PATCH 2/4] add tests --- .github/workflows/workflow.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 86113d7..296f8fe 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -207,6 +207,10 @@ jobs: shell: bash - run: ./setup.sh -t -p -c '/tmp/flutter/:channel:-:version:-:hash:' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da' shell: bash + - run: ./setup.sh -t -p -d '/tmp/flutter/:channel:-:version:-:hash:-pub-cache-path' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da-pub-cache-path' + shell: bash + - run: ./setup.sh -t -p -l '/tmp/flutter/:channel:-:version:-:hash:-pub-cache-key' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da-pub-cache-key' + shell: bash test_print_output_arm64: @@ -276,3 +280,7 @@ jobs: shell: bash - run: ./setup.sh -t -p -c '/tmp/flutter/:channel:-:version:-:hash:' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da' shell: bash + - run: ./setup.sh -t -p -d '/tmp/flutter/:channel:-:version:-:hash:-pub-cache-path' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da-pub-cache-path' + shell: bash + - run: ./setup.sh -t -p -l '/tmp/flutter/:channel:-:version:-:hash:-pub-cache-key' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da-pub-cache-key' + shell: bash From d5714a59a5143e28846e2143ef6d357c5419c4ff Mon Sep 17 00:00:00 2001 From: Nicholas Beninato Date: Mon, 9 Jun 2025 15:06:49 -0700 Subject: [PATCH 3/4] add dash --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f2a1395..a20c429 100644 --- a/README.md +++ b/README.md @@ -302,7 +302,7 @@ steps: # optional parameters follow cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path - pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies + pub-cache-key: "flutter-pub-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path - run: flutter --version ``` From c5698cc48793320b4a067d1531c699a4c3ff321f Mon Sep 17 00:00:00 2001 From: Nicholas Beninato Date: Mon, 9 Jun 2025 15:07:04 -0700 Subject: [PATCH 4/4] use PUB_CACHE --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index e4b9ef2..d36a9e0 100755 --- a/setup.sh +++ b/setup.sh @@ -180,7 +180,7 @@ expand_key() { CACHE_KEY=$(expand_key "$CACHE_KEY") PUB_CACHE_KEY=$(expand_key "$PUB_CACHE_KEY") CACHE_PATH=$(expand_key "$(transform_path "$CACHE_PATH")") -PUB_CACHE_PATH=$(expand_key "$(transform_path "$PUB_CACHE_PATH")") +PUB_CACHE=$(expand_key "$(transform_path "$PUB_CACHE")") if [ "$PRINT_ONLY" = true ]; then version_info=$(echo "$VERSION_MANIFEST" | jq -j '.channel,":",.version,":",.dart_sdk_arch // "x64"')