feat(ci): build app for PRs and pushes to main
This commit is contained in:
parent
032bf1c532
commit
1bfec41239
|
@ -0,0 +1,42 @@
|
|||
name: Flutter Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build-app:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '12.x'
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v1
|
||||
with:
|
||||
channel: stable
|
||||
|
||||
- name: Cache pub dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.FLUTTER_HOME }}/.pub-cache
|
||||
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
|
||||
restore-keys: ${{ runner.os }}-pub-
|
||||
|
||||
- name: Download pub dependencies
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build Android App Bundle
|
||||
run: flutter build appbundle
|
||||
|
||||
- name: Build Android APK
|
||||
run: flutter build apk
|
||||
|
|
@ -21,10 +21,12 @@ jobs:
|
|||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '12.x'
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v1
|
||||
with:
|
||||
channel: stable
|
||||
|
||||
- name: Flutter version
|
||||
run: flutter --version
|
||||
|
||||
|
|
Reference in New Issue