Skip to content

Commit

Permalink
support sdk version wildcard format (#106)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
devoncarew committed Sep 29, 2023
1 parent 8a4b97e commit 8ef13bc
Show file tree
Hide file tree
Showing 11 changed files with 1,278 additions and 625 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/dart.yml
Expand Up @@ -82,7 +82,25 @@ jobs:
- uses: ./
with:
sdk: ${{ matrix.sdk }}
architecture: ia32

- name: Run hello world
run: |
echo "main() { print('hello world'); }" > hello.dart
dart hello.dart
- run: dart --version

# Test getting the latest patch release for a major.minor sdk parameter.
test_latest_patch_release:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [2.19, 3.1]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: ./
with:
sdk: ${{ matrix.sdk }}

- name: Run hello world
run: |
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## v1.6.0

* Enable provisioning of the latest Dart SDK patch release by specifying just
the major and minor version (e.g. `3.2`).

## v1.5.1

* No longer test the `setup-dart` action on pre-2.12 SDKs.
Expand Down
12 changes: 7 additions & 5 deletions README.md
Expand Up @@ -36,11 +36,13 @@ jobs:

The action takes the following inputs:

* `sdk`: Which SDK version to setup. Can be specified using one of two forms:
* A specific SDK version, e.g. `2.19.0` or `2.12.0-1.4.beta`
* `sdk`: Which SDK version to setup. Can be specified using one of three forms:
* A release channel, which will install the latest build from that channel.
Available channels are `stable`, `beta`, `dev`, and `main`.
See the [Dart SDK archive](https://dart.dev/get-dart/archive) for details.
Available channels are `stable`, `beta`, `dev`, and `main`. See the
[Dart SDK archive](https://dart.dev/get-dart/archive) for details.
* An SDK release version - e.g. `2.19` or `3.1`. This will install the
latest patch release for that specific release version.
* A specific SDK version, e.g. `2.19.0` or `2.12.0-1.4.beta`.

* `flavor`: Which build flavor to setup.
* The available build flavors are `release` and `raw`.
Expand Down Expand Up @@ -89,7 +91,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
sdk: [2.18.0, stable, beta, dev]
sdk: [3.1, stable, beta, dev]
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
Expand Down
7 changes: 3 additions & 4 deletions action.yml
Expand Up @@ -6,10 +6,9 @@ branding:
inputs:
sdk:
description: >-
The channel, or a specific version from a channel to install ('stable',
'beta', 'dev', '2.7.2', '2.12.0-1.4.beta'). Using one of the named
channels instead of a version will give you the latest version published
to that channel.
This can be either the channel to install (i.e., 'stable', 'beta', 'dev'),
an SDK release version (i.e., `2.19`, `3.1`), or a specific SDK version
(i.e, '2.19.1', '3.0.0-1.4.beta').
required: false
default: "stable"
architecture:
Expand Down

0 comments on commit 8ef13bc

Please sign in to comment.