diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 06a8d1c..509b5db 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -17,7 +17,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - version: + version: + - latest - 3.3.0 - 3.0.0 - 2.10.5 @@ -47,7 +48,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - version: + version: + - latest - 3.3.0-0.0.pre - 3.1.0 steps: diff --git a/setup.sh b/setup.sh index 3a70219..fac9c7e 100755 --- a/setup.sh +++ b/setup.sh @@ -9,6 +9,16 @@ FLUTTER_VERSION=${1:-3.0.2} FLUTTER_CHANNEL=${2:-stable} FLUTTER_OS=$OS +# Detect the latest version +if [[ $FLUTTER_VERSION == "latest" ]] +then + echo "Detecting latest version..." + curl -L https://storage.googleapis.com/flutter_infra_release/releases/releases_$OS.json -o "${RUNNER_TEMP}/flutter_release.json" + CURRENT_RELEASE=$(jq -r ".current_release.${FLUTTER_CHANNEL}" "${RUNNER_TEMP}/flutter_release.json") + FLUTTER_VERSION=$(jq -r ".releases | map(select(.hash == \"${CURRENT_RELEASE}\")) | .[0].version" "${RUNNER_TEMP}/flutter_release.json") + rm "${RUNNER_TEMP}/flutter_release.json" +fi + # OS archive file extension EXT="zip" if [[ $OS == linux ]]