Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input to automatically setup Flutter #26

Merged
merged 3 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/test.yaml → .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- run: echo ${{ env.FLUTTER_VERSION }}
- run: echo ${{ env.FLUTTER_CHANNEL }}

test-setup:
name: Setup
test-setup-flutter:
name: Setup Flutter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -36,5 +36,5 @@ jobs:
uses: ./
with:
path: test/.fvmrc
setup-flutter: true
setup: true
- run: flutter --version
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,24 @@ can then be used to configure the [flutter-action](https://github.com/subosito/f

## Usage

All the sample options below can be combined with each other.

### Basic usage

The configuration will parse the FVM configuration and use subosito/flutter-action to install & cache 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
```

### Basic usage with manual configuration
```yaml
steps:
- uses: actions/checkout@v4
Expand Down
20 changes: 13 additions & 7 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ inputs:
description: 'Flavor to use'
required: false
default: ''
setup-flutter:
description: 'Setup Flutter (default: false)'
setup:
description: 'Setup Flutter via "subosito/flutter-action"? (default: false)'
required: false
default: 'false'
cache:
description: 'Cache Flutter via "subosito/flutter-action"? (default: true - if setup is true)'
required: false
default: 'true'
outputs:
FLUTTER_VERSION:
description: 'The version of Flutter specified in the fvm configuration file'
Expand All @@ -23,17 +27,19 @@ outputs:
runs:
using: 'composite'
steps:
- uses: ./config-action
- name: Parse configuration
uses: ./config-action
id: config-action
with:
path: ${{ inputs.path }}
flavor: ${{ inputs.flavor }}
- uses: subosito/flutter-action@v2
if: inputs.setup-flutter == 'true'
- name: Setup Flutter
uses: subosito/flutter-action@v2
if: inputs.setup == 'true'
with:
cache: true
cache: ${{ inputs.cache }}
flutter-version: ${{ steps.config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.config-action.outputs.FLUTTER_CHANNEL }}
branding:
icon: 'maximize'
color: 'blue'
color: 'blue'