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

add any channel

This commit is contained in:
Alif Rachmawadi 2022-01-06 09:17:20 +00:00
parent c64fa18722
commit 37e2edb15e
No known key found for this signature in database
GPG key ID: DD1F490C879BFA91
2 changed files with 21 additions and 2 deletions

View file

@ -43,7 +43,7 @@ jobs:
- name: Run flutter --version - name: Run flutter --version
shell: bash shell: bash
run: flutter --version run: flutter --version
test_master: test_master_channel:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Checkout - name: Checkout
@ -57,3 +57,18 @@ jobs:
- name: Run flutter --version - name: Run flutter --version
shell: bash shell: bash
run: flutter --version run: flutter --version
test_any_channel:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: ./
with:
channel: any
flutter-version: 2
- name: Run dart --version
shell: bash
run: dart --version
- name: Run flutter --version
shell: bash
run: flutter --version

View file

@ -18,7 +18,11 @@ latest_version() {
} }
wildcard_version() { wildcard_version() {
if [[ $1 == any ]]; then
jq --arg version "^$2" '.releases | map(select(.version | test($version))) | first'
else
jq --arg channel "$1" --arg version "^$2" '.releases | map(select(.channel==$channel) | select(.version | test($version))) | first' jq --arg channel "$1" --arg version "^$2" '.releases | map(select(.channel==$channel) | select(.version | test($version))) | first'
fi
} }
get_version() { get_version() {