-
-
Notifications
You must be signed in to change notification settings - Fork 22
90 lines (74 loc) · 2.43 KB
/
build_apk.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Build fat apk and splitted apk(s)
name: Build Android (.apk(s))
"on":
pull_request:
branches:
- master
workflow_dispatch:
inputs:
flutterChannel:
description: "Flutter channel"
default: stable
required: true
type: choice
options:
- stable
- beta
- master
jobs:
build_android:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ inputs.flutterChannel }}
- name: Decoding android/key.properties
run: echo "${{ secrets.KEY_PROP }}" | base64 --decode > android/key.properties
- name: Decoding android/key.jks
run: echo "${{ secrets.KEY_JKS }}" | base64 --decode > android/key.jks
- name: Build splitted apk(s)
run: |
flutter pub get
flutter build apk --split-per-abi --release -v
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: splitted apk artifacts
path: build/app/outputs/apk/release/*.apk
- name: Upload artifacts (arm64-v8a)
uses: actions/upload-artifact@v4
with:
name: arm64-v8a artifact
path: build/app/outputs/apk/release/*-arm64-v8a-release.apk
- name: Upload artifacts (armeabi-v7a)
uses: actions/upload-artifact@v4
with:
name: armeabi-v7a artifact
path: build/app/outputs/apk/release/*-armeabi-v7a-release.apk
- name: Upload artifacts (x86_64)
uses: actions/upload-artifact@v4
with:
name: x86_64 artifact
path: build/app/outputs/apk/release/*-x86_64-release.apk
# The previous apk will be deleted when re-running the flutter build apk again
# So we don't need to worry about the glob pattern for the fat apk
- name: Build fat apk
run: |
flutter pub get
flutter build apk --release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: fat apk artifact
path: build/app/outputs/apk/release/*.apk
- name: Write summary
run: |
echo ":blue_heart: Using **`flutter --version`**" >> $GITHUB_STEP_SUMMARY