Skip to content

Commit 8ef13bc

Browse files
authored
support sdk version wildcard format (#106)
* support sdk version wildcard format * revert changes to raw flavor * add print statements * trim last path element * remove print statements * update to the latest package:dart_flutter_team_lints * change the wildcard format to '2.19' * review feedback
1 parent 8a4b97e commit 8ef13bc

11 files changed

+1278
-625
lines changed

.github/workflows/dart.yml

+19-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,25 @@ jobs:
8282
- uses: ./
8383
with:
8484
sdk: ${{ matrix.sdk }}
85-
architecture: ia32
85+
86+
- name: Run hello world
87+
run: |
88+
echo "main() { print('hello world'); }" > hello.dart
89+
dart hello.dart
90+
- run: dart --version
91+
92+
# Test getting the latest patch release for a major.minor sdk parameter.
93+
test_latest_patch_release:
94+
runs-on: ubuntu-latest
95+
strategy:
96+
matrix:
97+
sdk: [2.19, 3.1]
98+
fail-fast: false
99+
steps:
100+
- uses: actions/checkout@v3
101+
- uses: ./
102+
with:
103+
sdk: ${{ matrix.sdk }}
86104

87105
- name: Run hello world
88106
run: |

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## v1.6.0
2+
3+
* Enable provisioning of the latest Dart SDK patch release by specifying just
4+
the major and minor version (e.g. `3.2`).
5+
16
## v1.5.1
27

38
* No longer test the `setup-dart` action on pre-2.12 SDKs.

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ jobs:
3636
3737
The action takes the following inputs:
3838
39-
* `sdk`: Which SDK version to setup. Can be specified using one of two forms:
40-
* A specific SDK version, e.g. `2.19.0` or `2.12.0-1.4.beta`
39+
* `sdk`: Which SDK version to setup. Can be specified using one of three forms:
4140
* A release channel, which will install the latest build from that channel.
42-
Available channels are `stable`, `beta`, `dev`, and `main`.
43-
See the [Dart SDK archive](https://dart.dev/get-dart/archive) for details.
41+
Available channels are `stable`, `beta`, `dev`, and `main`. See the
42+
[Dart SDK archive](https://dart.dev/get-dart/archive) for details.
43+
* An SDK release version - e.g. `2.19` or `3.1`. This will install the
44+
latest patch release for that specific release version.
45+
* A specific SDK version, e.g. `2.19.0` or `2.12.0-1.4.beta`.
4446

4547
* `flavor`: Which build flavor to setup.
4648
* The available build flavors are `release` and `raw`.
@@ -89,7 +91,7 @@ jobs:
8991
strategy:
9092
matrix:
9193
os: [ubuntu-latest, macos-latest, windows-latest]
92-
sdk: [2.18.0, stable, beta, dev]
94+
sdk: [3.1, stable, beta, dev]
9395
steps:
9496
- uses: actions/checkout@v3
9597
- uses: dart-lang/setup-dart@v1

action.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ branding:
66
inputs:
77
sdk:
88
description: >-
9-
The channel, or a specific version from a channel to install ('stable',
10-
'beta', 'dev', '2.7.2', '2.12.0-1.4.beta'). Using one of the named
11-
channels instead of a version will give you the latest version published
12-
to that channel.
9+
This can be either the channel to install (i.e., 'stable', 'beta', 'dev'),
10+
an SDK release version (i.e., `2.19`, `3.1`), or a specific SDK version
11+
(i.e, '2.19.1', '3.0.0-1.4.beta').
1312
required: false
1413
default: "stable"
1514
architecture:

0 commit comments

Comments
 (0)