-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (67 loc) · 2.83 KB
/
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: android build
on:
push:
tags: v**
# https://medium.com/steeple-product/ci-cd-for-a-flutter-app-with-github-actions-android-release-and-deployment-dca7e787ca26
jobs:
build:
runs-on: ubuntu-latest
environment: android
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.13.2"
channel: "stable"
cache: true
- uses: actions/setup-go@v4
with:
go-version: "^1.21.0"
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: compile mage
run: go mod download && go run magefiles/cmd/mage.go -compile ../mage
- name: display telemetry
run: flutter --disable-telemetry
- name: Install dependencies
run: ./mage PubGlobalUpgrade PubGet CreateI18nSynthetic BuildRunner CreateVersion CreateI18n
- name: Retrieve base64 keystore and decode it to a file
env:
KEYSTORE_BASE64: ${{secrets.KEYSTORE_FILE_BASE64}}
run: |
echo "$KEYSTORE_BASE64" | base64 -i -d > "${{github.workspace}}/android-keystore.jks"
- name: "Create 'key.properties' file"
env:
KEYSTORE_PROPERTIES_PATH: ${{github.workspace}}/android/key.properties
run: |
echo 'storeFile=${{github.workspace}}/android-keystore.jks' > $KEYSTORE_PROPERTIES_PATH
echo 'keyAlias=${{secrets.KEYSTORE_KEY_ALIAS}}' >> $KEYSTORE_PROPERTIES_PATH
echo 'storePassword=${{secrets.KEYSTORE_PASSWORD}}' >> $KEYSTORE_PROPERTIES_PATH
echo 'keyPassword=${{secrets.KEYSTORE_KEY_PASSWORD}}' >> $KEYSTORE_PROPERTIES_PATH
- name: Build APK
run: flutter build apk --flavor prod
- name: Build AppBundle
run: flutter build appbundle --flavor prod
- name: Keep apk
uses: actions/upload-artifact@v3
with:
name: android apk
path: ${{github.workspace}}/build/app/outputs/flutter-apk/app-prod-release.apk
- name: Keep appbundle
uses: actions/upload-artifact@v3
with:
name: android appbundle
path: ${{github.workspace}}/build/app/outputs/bundle/prodRelease/app-prod-release.aab
- name: Upload Android
uses: r0adkll/[email protected]
with:
packageName: docscan.fiurthorn.software.prod
track: internal
status: draft
releaseFiles: ${{github.workspace}}/build/app/outputs/bundle/prodRelease/app-prod-release.aab
serviceAccountJsonPlainText: "${{secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_KEY_JSON}}"
mappingFile: ${{github.workspace}}/build/app/outputs/mapping/prodRelease/mapping.txt
debugSymbols: ${{github.workspace}}/build/app/intermediates/merged_native_libs/prodRelease/out/lib