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:
parent
0c3f14223a
commit
29ad5bdaf4
2 changed files with 12 additions and 3 deletions
5
.github/workflows/workflow.yml
vendored
5
.github/workflows/workflow.yml
vendored
|
@ -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
|
||||
|
|
10
setup.sh
10
setup.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue