1
0
Fork 0
mirror of https://github.com/subosito/flutter-action.git synced 2024-08-16 10:19:50 +02:00

Update for any-version on any-channel (#155)

* Update for testing any-version on any-channel

* Update `latest_version` and Add `latest_channel_version`
This commit is contained in:
Jiun Kim 2022-06-05 18:06:25 +09:00 committed by GitHub
parent 0c3f14223a
commit 29ad5bdaf4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -65,13 +65,16 @@ jobs:
run: flutter --version
test_any_channel:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 2, any ]
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./
with:
channel: any
flutter-version: 2
flutter-version: ${{ matrix.version }}
- name: Run dart --version
shell: bash
run: dart --version

View file

@ -14,6 +14,10 @@ normalize_version() {
}
latest_version() {
jq --arg arch "$ARCH" '.releases | map(select(.dart_sdk_arch == null or .dart_sdk_arch == $arch)) | first'
}
latest_channel_version() {
jq --arg channel "$1" --arg arch "$ARCH" '.releases | map(select(.channel==$channel) | select(.dart_sdk_arch == null or .dart_sdk_arch == $arch)) | first'
}
@ -32,8 +36,10 @@ wildcard_version() {
}
get_version() {
if [[ $2 == any ]]; then
latest_version $1
if [[ $1 == any && $2 == any ]]; then
latest_version
elif [[ $2 == any ]]; then
latest_channel_version $1
else
wildcard_version $1 $2
fi