-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
114 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,80 @@ | ||
# flutter-fvm-config-action | ||
An action that parses an [FVM](https://github.com/leoafarias/fvm) config file (.fvmrc) into environment variables which | ||
can then be used to configure the [flutter-action](https://github.com/subosito/flutter-action). | ||
|
||
## Usage | ||
An action that parses an [FVM](https://github.com/leoafarias/fvm) config file `.fvmrc` and configures the [subosito/flutter-action](https://github.com/subosito/flutter-action) | ||
to install the Flutter SDK. | ||
|
||
All the sample options below can be combined with each other. | ||
An additional action is provided that just parses the FVM config into outputs & environment variables which | ||
can then be used to manually configure the [subosito/flutter-action](https://github.com/subosito/flutter-action). | ||
|
||
## Usage | ||
|
||
### Basic usage | ||
### Basic setup `kuhnroyal/flutter-fvm-config-action/setup` | ||
|
||
The configuration will parse the FVM configuration and use subosito/flutter-action to install & cache the configured Flutter version. | ||
The configuration will parse the FVM configuration and use subosito/flutter-action to install the configured Flutter version. | ||
|
||
```yaml | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: kuhnroyal/flutter-fvm-config-action@v2 | ||
with: | ||
# The setup flag enables installation of the Flutter SDK, will default to true in the next major version (v3) | ||
setup: true | ||
# The cache flag enables caching of the Flutter SDK, default is true - if setup is true | ||
cache: true | ||
- uses: kuhnroyal/flutter-fvm-config-action/setup@develop | ||
``` | ||
### Basic usage with manual configuration | ||
### Manual configuration & setup `kuhnroyal/flutter-fvm-config-action/config` | ||
|
||
```yaml | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: kuhnroyal/flutter-fvm-config-action@v2 | ||
- uses: kuhnroyal/flutter-fvm-config-action/config@develop | ||
id: fvm-config-action | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | ||
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} | ||
``` | ||
|
||
> [!IMPORTANT] | ||
> The main action `kuhnroyal/flutter-fvm-config-action` will continue to work and can be configured either way. | ||
|
||
## Configuration inputs | ||
|
||
All the sample options below can be combined with each other. | ||
|
||
### Custom config path | ||
|
||
If you have a custom path for your `.fvmrc` file, you can set it with the `path` input. | ||
|
||
```yaml | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: kuhnroyal/flutter-fvm-config-action@v2 | ||
id: fvm-config-action | ||
- uses: kuhnroyal/flutter-fvm-config-action/setup@develop | ||
with: | ||
path: 'some-path/.fvmrc' | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | ||
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} | ||
``` | ||
|
||
### Reading specific flavor | ||
### FVM flavor | ||
|
||
If you require a specific flavor, you can set it with the `flavor` input. | ||
|
||
```yaml | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: kuhnroyal/flutter-fvm-config-action@v2 | ||
id: fvm-config-action | ||
- uses: kuhnroyal/flutter-fvm-config-action/setup@develop | ||
with: | ||
flavor: 'staging' | ||
- uses: subosito/flutter-action@v2 | ||
``` | ||
|
||
### Enable Dart/Flutter analytics | ||
|
||
Analytics are disabled by default. To enable them, set `disable-analytics` to `false`. | ||
|
||
```yaml | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: kuhnroyal/flutter-fvm-config-action/setup@develop | ||
with: | ||
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | ||
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} | ||
disable-analytics: false | ||
``` | ||
|
||
### Caching | ||
|
||
This action supports all cache inputs from the [subosito/flutter-action](https://github.com/subosito/flutter-action): | ||
See https://github.com/subosito/flutter-action#caching for more information. | ||
See https://github.com/subosito/flutter-action#caching for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: 'Flutter FVM setup action' | ||
description: 'Action that parses an FVM config file and sets up the subosito/flutter-action.' | ||
author: 'Peter Leibiger' | ||
inputs: | ||
path: | ||
description: 'Path to the FVM config file' | ||
required: false | ||
flavor: | ||
description: 'Flavor to use' | ||
required: false | ||
default: '' | ||
disable-analytics: | ||
description: 'Disable analytics for Flutter and Dart' | ||
required: false | ||
default: 'true' | ||
cache: | ||
description: 'Cache Flutter via "subosito/flutter-action"? (default: true - if setup is true)' | ||
required: false | ||
default: 'true' | ||
cache-key: | ||
description: 'Identifier for the Flutter SDK cache' | ||
required: false | ||
default: '' | ||
cache-path: | ||
description: 'Flutter SDK cache path' | ||
required: false | ||
default: '' | ||
pub-cache-key: | ||
description: 'Identifier for the Dart .pub-cache cache' | ||
required: false | ||
default: '' | ||
pub-cache-path: | ||
description: 'Flutter pub cache path' | ||
required: false | ||
default: default | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Parse configuration | ||
uses: kuhnroyal/flutter-fvm-config-action/config@develop | ||
id: config | ||
with: | ||
path: ${{ inputs.path }} | ||
flavor: ${{ inputs.flavor }} | ||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ steps.config.outputs.FLUTTER_VERSION }} | ||
channel: ${{ steps.config.outputs.FLUTTER_CHANNEL }} | ||
cache: ${{ inputs.cache }} | ||
cache-key: ${{ inputs.cache-key }} | ||
cache-path: ${{ inputs.cache-path }} | ||
pub-cache-key: ${{ inputs.pub-cache-key }} | ||
pub-cache-path: ${{ inputs.pub-cache-path }} | ||
- shell: sh | ||
if: inputs.disable-analytics == 'true' | ||
run: | | ||
flutter config --no-analytics | ||
dart --disable-analytics | ||
branding: | ||
icon: 'maximize' | ||
color: 'blue' |