-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (51 loc) · 1.45 KB
/
build-android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build an Android APK
on:
push:
paths:
- '*'
- '.github/workflows/build-android.yml'
- 'lib/**'
- 'android/**'
- '!**/*.md'
branches:
- flutter
jobs:
build-apk:
permissions:
contents: write
name: Build Android APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup Java environment in order to build the Android app.
- name: Setup Java environment
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
# Setup gradle using official gradle action
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
add-job-summary: 'on-failure'
# Setup the flutter environment.
- name: Setup Flutter environment
uses: subosito/flutter-action@v2
with:
cache: true
# Get flutter dependencies.
- name: Install Flutter dependencies
run: flutter pub get
# Statically analyze the Dart code for any errors.
# - run: flutter analyze .
# Run tests
# - run: flutter test
# Build the Android apk.
- name: Build Android APK
run: flutter build apk
# Upload generated apk to the artifacts.
- name: Save apk file as artifact
uses: actions/upload-artifact@v4
with:
name: flutter-actions-test
path: build/app/outputs/flutter-apk/app-release.apk