Skip to content

Commit

Permalink
docs: update docs to v2, add precache recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
wrbl606 committed Jul 12, 2024
1 parent cff3169 commit 345209a
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Copy and paste the following snippet into your action's `.yml` file.

```yaml
- name: Install Flutter
uses: monterail/flutter-action@v1
uses: monterail/flutter-action@v2
```
## Usage
Expand All @@ -21,7 +21,7 @@ With Flutter SDK for GitHub Actions you can do the following:
```yaml
steps:
- uses: monterail/flutter-action@v1
- uses: monterail/flutter-action@v2
- run: flutter build ...
```
Expand All @@ -32,6 +32,7 @@ steps:
| Name | Description | Default |
| --- | --- | --- |
| `channel` | Flutter [channel](https://github.com/flutter/flutter/wiki/Flutter-build-release-channels) | `stable` |
| `precache` | `flutter precache` arguments list, see [recipe](#precache-web-and-android-build-tools) | no-op |

## Recipes

Expand All @@ -56,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: monterail/flutter-action@v1
- uses: monterail/flutter-action@v2
- run: flutter pub get
- uses: invertase/github-action-dart-analyzer@v3
with:
Expand Down Expand Up @@ -86,7 +87,39 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: monterail/flutter-action@v1
- uses: monterail/flutter-action@v2
- run: flutter pub get
- run: flutter build web
- uses: actions/upload-artifact@v4
with:
name: web-app
path: build/web
```

</details>

### Precache web and Android build tools

By default Flutter will fetch the tools necessary to build specific platforms after `flutter build` command is ran. The process can be sped up with precaching specific platforms at Flutter installation stage.

<details>

```yaml
name: Setup Flutter for web and Android builds
on:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: monterail/flutter-action@v2
with:
precache: "--web --android"
- run: flutter pub get
- run: flutter build web
- uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 345209a

Please sign in to comment.