From 0f2cd3391b2bfa32c731e6dc28acac302cfa8cbe Mon Sep 17 00:00:00 2001 From: Jiun Kim <40026920+KKimj@users.noreply.github.com> Date: Fri, 29 Apr 2022 09:52:26 +0900 Subject: [PATCH] Update architecture default as `runner.arch` (#153) * Update architecture default as `runner.arch` * Update to convert `ARCH` as lowercase * Refactor for `ARCH` variable --- action.yml | 2 +- setup.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index f4340ec..578503f 100644 --- a/action.yml +++ b/action.yml @@ -27,7 +27,7 @@ inputs: architecture: description: 'The architecture of Flutter SDK executable (x64 or arm64)' required: false - default: 'x64' + default: ${{ runner.arch }} runs: using: 'composite' steps: diff --git a/setup.sh b/setup.sh index 1cb0e59..8d048aa 100755 --- a/setup.sh +++ b/setup.sh @@ -25,7 +25,7 @@ wildcard_version() { jq --arg channel "$1" --arg version "$2" '.releases | map(select(.channel==$channel) | select(.version | startswith($version) )) | first' fi elif [[ $1 == any ]]; then - jq --arg version "$2" --arg arch "$ARCH" '.releases | map(select(.version | startswith($version)) | select(.dart_sdk_arch == null or .dart_sdk_arch == $arch)) | first' + jq --arg version "$2" --arg arch "$ARCH" '.releases | map(select(.version | startswith($version)) | select(.dart_sdk_arch == null or .dart_sdk_arch == $arch)) | first' else jq --arg channel "$1" --arg version "$2" --arg arch "$ARCH" '.releases | map(select(.channel==$channel) | select(.version | startswith($version) ) | select(.dart_sdk_arch == null or .dart_sdk_arch == $arch)) | first' fi @@ -95,7 +95,7 @@ done CHANNEL="${@:$OPTIND:1}" VERSION="${@:$OPTIND+1:1}" -ARCH="${@:$OPTIND+2:1}" +ARCH=$(echo "${@:$OPTIND+2:1}" | awk '{print tolower($0)}') SDK_CACHE="$(transform_path ${CACHE_PATH})" PUB_CACHE="$(transform_path ${CACHE_PATH}/.pub-cache)"