-
Notifications
You must be signed in to change notification settings - Fork 515
77 lines (67 loc) · 2.27 KB
/
build-android.yaml
File metadata and controls
77 lines (67 loc) · 2.27 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
66
67
68
69
70
71
72
73
74
75
76
77
name: Build Android
on:
workflow_call:
inputs:
version:
required: true
type: string
flutter_version:
required: true
type: string
secrets:
KEYSTORE_BASE64:
required: true
KEYSTORE_PASSWORD:
required: true
KEY_PASSWORD:
required: true
KEY_ALIAS:
required: true
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ inputs.flutter_version }}
- name: Get Dependencies
run: |
flutter --version
flutter pub get
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
check-latest: true
- name: Setup Android signing
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/app/keystore.jks
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" > android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
echo "storeFile=keystore.jks" >> android/key.properties
- name: Build for Android
run: |
flutter gen-l10n
dart run build_runner build --delete-conflicting-outputs
flutter build apk --release
flutter build apk --split-per-abi
- name: Rename builds
run: |
cd build/app/outputs/flutter-apk
mv app-armeabi-v7a-release.apk Anx-Reader-android-${{ inputs.version }}-armeabi-v7a.apk
mv app-arm64-v8a-release.apk Anx-Reader-android-${{ inputs.version }}-arm64-v8a.apk
mv app-x86_64-release.apk Anx-Reader-android-${{ inputs.version }}-x86_64.apk
mv app-release.apk Anx-Reader-android-${{ inputs.version }}-universal.apk
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: android-artifacts
path: build/app/outputs/flutter-apk/*.apk
if-no-files-found: error