Skip to content

Commit

Permalink
Create flutter-build-android.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hoc081098 authored Nov 22, 2021
1 parent aed8cb5 commit 9b994b8
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/flutter-build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Flutter build Android

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
flutter-channel: [ 'stable', 'beta' ]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'

- name: Cache gradle, wrapper and buildSrc
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-
- uses: subosito/flutter-action@v1
with:
channel: ${{ matrix.flutter-channel }}

- name: Print Dart SDK version
run: dart --version

- name: Print Flutter SDK version
run: flutter --version

- name: Install dependencies
run: flutter pub get

- name: Format code
run: flutter format lib --set-exit-if-changed

# - name: Analyze
# run: flutter analyze lib

# - name: Gen code
# run: flutter packages pub run build_runner build --delete-conflicting-outputs

- name: Build APK
run: flutter build apk --no-shrink

- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: app
path: build/app/outputs/apk/release/app-release.apk

0 comments on commit 9b994b8

Please sign in to comment.