subosito / flutter-action

Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
MIT License
2.17k stars 193 forks source link

Support reading Flutter version from config file (FVM) #101

Closed kuhnroyal closed 2 years ago

kuhnroyal commented 3 years ago

I want to bring this up for consideration. FVM (https://github.com/leoafarias/fvm) is a pretty popular version manager for Flutter. It would be great if the action would support reading the Flutter version/channel from its config file in .fvm/fvm_config.json similar to the ruby action and others.

Currently I am reading the version manually from the JSON file in every pipeline:

      - name: Determine Flutter version
        uses: antifree/json-to-variables@v1.0.1
        with:
          filename: '.fvm/fvm_config.json'
          prefix: fvm
      - uses: subosito/flutter-action@v1
        with:
          flutter-version: ${{ env.fvm_flutterSdkVersion }}

This could just be something like this:

    - uses: subosito/flutter-action@v1
      with:
        flutter-version: '.fvm/fvm_config.json'

I would love to create a PR if there is interest for this.

kuhnroyal commented 2 years ago

I created a simple action that parses the FVM config file. It can be used together with flutter-action as well as with custom setup.

https://github.com/kuhnroyal/flutter-fvm-config-action