|
1 | 1 | # flutter-fvm-config-action |
2 | | -An action that parses an [FVM](https://github.com/leoafarias/fvm) config file (.fvmrc) into environment variables which |
3 | | -can then be used to configure the [flutter-action](https://github.com/subosito/flutter-action). |
4 | 2 |
|
5 | | -## Usage |
| 3 | +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) |
| 4 | +to install the Flutter SDK. |
6 | 5 |
|
7 | | -All the sample options below can be combined with each other. |
| 6 | +An additional action is provided that just parses the FVM config into outputs & environment variables which |
| 7 | +can then be used to manually configure the [subosito/flutter-action](https://github.com/subosito/flutter-action). |
| 8 | + |
| 9 | +## Usage |
8 | 10 |
|
9 | | -### Basic usage |
| 11 | +### Basic setup `kuhnroyal/flutter-fvm-config-action/setup` |
10 | 12 |
|
11 | | -The configuration will parse the FVM configuration and use subosito/flutter-action to install & cache the configured Flutter version. |
| 13 | +The configuration will parse the FVM configuration and use subosito/flutter-action to install the configured Flutter version. |
12 | 14 |
|
13 | 15 | ```yaml |
14 | 16 | steps: |
15 | 17 | - uses: actions/checkout@v4 |
16 | | - - uses: kuhnroyal/flutter-fvm-config-action@v2 |
17 | | - with: |
18 | | - # The setup flag enables installation of the Flutter SDK, will default to true in the next major version (v3) |
19 | | - setup: true |
20 | | - # The cache flag enables caching of the Flutter SDK, default is true - if setup is true |
21 | | - cache: true |
| 18 | + - uses: kuhnroyal/flutter-fvm-config-action/setup@develop |
22 | 19 | ``` |
23 | 20 |
|
24 | | -### Basic usage with manual configuration |
| 21 | +### Manual configuration & setup `kuhnroyal/flutter-fvm-config-action/config` |
| 22 | + |
25 | 23 | ```yaml |
26 | 24 | steps: |
27 | 25 | - uses: actions/checkout@v4 |
28 | | - - uses: kuhnroyal/flutter-fvm-config-action@v2 |
| 26 | + - uses: kuhnroyal/flutter-fvm-config-action/config@develop |
29 | 27 | id: fvm-config-action |
30 | 28 | - uses: subosito/flutter-action@v2 |
31 | 29 | with: |
32 | 30 | flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} |
33 | 31 | channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} |
34 | 32 | ``` |
35 | 33 |
|
| 34 | +> [!IMPORTANT] |
| 35 | +> The main action `kuhnroyal/flutter-fvm-config-action` will continue to work and can be configured either way. |
| 36 | + |
| 37 | +## Configuration inputs |
| 38 | + |
| 39 | +All the sample options below can be combined with each other. |
| 40 | + |
36 | 41 | ### Custom config path |
| 42 | + |
| 43 | +If you have a custom path for your `.fvmrc` file, you can set it with the `path` input. |
| 44 | + |
37 | 45 | ```yaml |
38 | 46 | steps: |
39 | 47 | - uses: actions/checkout@v4 |
40 | | - - uses: kuhnroyal/flutter-fvm-config-action@v2 |
41 | | - id: fvm-config-action |
| 48 | + - uses: kuhnroyal/flutter-fvm-config-action/setup@develop |
42 | 49 | with: |
43 | 50 | path: 'some-path/.fvmrc' |
44 | | - - uses: subosito/flutter-action@v2 |
45 | | - with: |
46 | | - flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} |
47 | | - channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} |
48 | 51 | ``` |
49 | 52 |
|
50 | | -### Reading specific flavor |
| 53 | +### FVM flavor |
| 54 | + |
| 55 | +If you require a specific flavor, you can set it with the `flavor` input. |
| 56 | + |
51 | 57 | ```yaml |
52 | 58 | steps: |
53 | 59 | - uses: actions/checkout@v4 |
54 | | - - uses: kuhnroyal/flutter-fvm-config-action@v2 |
55 | | - id: fvm-config-action |
| 60 | + - uses: kuhnroyal/flutter-fvm-config-action/setup@develop |
56 | 61 | with: |
57 | 62 | flavor: 'staging' |
58 | | - - uses: subosito/flutter-action@v2 |
| 63 | +``` |
| 64 | + |
| 65 | +### Enable Dart/Flutter analytics |
| 66 | + |
| 67 | +Analytics are disabled by default. To enable them, set `disable-analytics` to `false`. |
| 68 | + |
| 69 | +```yaml |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v4 |
| 72 | + - uses: kuhnroyal/flutter-fvm-config-action/setup@develop |
59 | 73 | with: |
60 | | - flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} |
61 | | - channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} |
| 74 | + disable-analytics: false |
62 | 75 | ``` |
63 | 76 |
|
64 | 77 | ### Caching |
65 | 78 |
|
66 | 79 | This action supports all cache inputs from the [subosito/flutter-action](https://github.com/subosito/flutter-action): |
67 | | -See https://github.com/subosito/flutter-action#caching for more information. |
| 80 | +See https://github.com/subosito/flutter-action#caching for more information. |
0 commit comments