-
Notifications
You must be signed in to change notification settings - Fork 12
65 lines (61 loc) · 1.79 KB
/
Copy pathbuild-android.yml
File metadata and controls
65 lines (61 loc) · 1.79 KB
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
63
64
65
name: Build Android
on:
workflow_call:
defaults:
run:
shell: bash
env:
PUB_ENVIRONMENT: bot.github
jobs:
build-android:
name: Build Android flutter app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
with:
distribution: temurin
java-version: "17"
cache: gradle
- name: Setup Flutter SDK
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Install example dependencies
working-directory: example
run: flutter pub get
- name: Test example
working-directory: example
run: flutter test
- name: Build example APK
working-directory: example
run: flutter build apk
- name: Check if example APK exists
working-directory: example
run: |
set -e
if [ ! -f build/app/outputs/apk/release/app-release.apk ]; then
echo "APK file not found!"
exit 1
fi
- name: Build example App Bundle
working-directory: example
run: flutter build appbundle
- name: Check if example App Bundle exists
working-directory: example
run: |
set -e
if [ ! -f build/app/outputs/bundle/release/app-release.aab ]; then
echo "App Bundle not found!"
exit 1
fi
- name: Cleanup
if: ${{ always() }}
working-directory: example
run: |
rm -rf build
if command -v flutter &>/dev/null; then
flutter clean
fi