You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like to define my Flutter version like this in pubspec.yaml:
name: awesome_flutter_appdescription: Some random cross-platform app.version: 1.0.0+1publish_to: noneenvironment:
sdk: ">=3.3.2 <4.0.0"flutter: 3.19.4dependencies:
# ...
This is useful and I really like it because it's very easy to retrieve the version with yq:
$ yq '.environment.flutter' pubspec.yaml
3.19.4
It avoids ambiguity and makes sure both developers and CI use the same Flutter version when building. Right now this is how I accomplish this in my workflows:
jobs:
main:
# ...steps:
# ...
- name: Set up Flutteruses: subosito/flutter-action@v2with:
channel: stableflutter-version-file: pubspec.yaml # path to the pubspec.yaml file
Of course, it would only work if yq '.environment.flutter' pubspec.yaml returns a valid semver version, and not something like flutter: ">=3.19.4". People who prefer things the way they are currently would not have to do anything at all, and continue using this action without any breaking changes.
This would be shorter
Both ubuntu-* and macos-* GitHub runners come with yq already installed (just like they come with jq already installed), so this small additional dependency shouldn't be blocker.
More context
The feature I suggest here is already available in several official GitHub Actions, such as actions/setup-go@v5 and actions/setup-ruby@v1. I think it'd be great if this awesome action also supported it :-)
Use case
I like to define my Flutter version like this in
pubspec.yaml
:This is useful and I really like it because it's very easy to retrieve the version with
yq
:$ yq '.environment.flutter' pubspec.yaml 3.19.4
It avoids ambiguity and makes sure both developers and CI use the same Flutter version when building. Right now this is how I accomplish this in my workflows:
Proposal
It'd be great if we could do this instead:
Of course, it would only work if
yq '.environment.flutter' pubspec.yaml
returns a valid semver version, and not something likeflutter: ">=3.19.4"
. People who prefer things the way they are currently would not have to do anything at all, and continue using this action without any breaking changes.This would be shorter
Both
ubuntu-*
andmacos-*
GitHub runners come withyq
already installed (just like they come withjq
already installed), so this small additional dependency shouldn't be blocker.More context
The feature I suggest here is already available in several official GitHub Actions, such as
actions/setup-go@v5
andactions/setup-ruby@v1
. I think it'd be great if this awesome action also supported it :-)This feature was discussed in Infer Flutter version from `pubspec.yaml` #215, but in a slightly different (worse) form
The text was updated successfully, but these errors were encountered: