-
-
Notifications
You must be signed in to change notification settings - Fork 22
111 lines (90 loc) · 3.19 KB
/
test_build_appbundle_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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Build all on release
on:
push:
jobs:
build_android:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Java
uses: actions/[email protected]
with:
distribution: "zulu"
java-version: "11"
- name: Setup Flutter
uses: subosito/[email protected]
with:
channel: "stable"
# File can be encoded to base64 on https://base64.guru/converter/encode/file
- 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 release appbundle
if: "!github.event.release.prerelease"
run: flutter build appbundle
- name: Upload aab
uses: actions/upload-artifact@v3
if: "!github.event.release.prerelease"
with:
name: app-release
path: build/app/outputs/bundle/release/app-release.aab
- name: Adding markdown
if: "!github.event.release.prerelease"
run: |
echo :white_check_mark: Build appbundle **todo: Publish to Google Play** >> $GITHUB_STEP_SUMMARY
- name: Build release APK(s) per ABIs
run: |
flutter pub get
flutter build apk --split-per-abi
- name: Adding markdown
run: |
echo ":white_check_mark: Build split apk" >> $GITHUB_STEP_SUMMARY
- name: Upload apks
uses: actions/upload-artifact@v3
with:
name: apk-releases
path: build/app/outputs/apk/release/*.apk
- name: Adding markdown
run: |
echo ":blue_heart: Using **`flutter --version`**" >> $GITHUB_STEP_SUMMARY
upload_assets:
runs-on: ubuntu-latest
needs: build_android
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: apk-releases
- name: Rename apk
run: curl -s https://gist.githubusercontent.com/iqfareez/f57405016cc8bcc51cdcd2879c88807a/raw/5d9bbed7231a9e56bf24b88ab5286cee73dae173/rename_apk.sh | bash -s MPT .
- name: Upload file to the assets release
uses: softprops/action-gh-release@v1
with:
files: "*.apk"
- name: Adding markdown
run: |
echo ":rocket: Added release apk(s) to assets" >> $GITHUB_STEP_SUMMARY
upload_google_play:
if: "!github.event.release.prerelease"
runs-on: ubuntu-latest
needs: build_android
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: app-release
- name: Upload file to the assets release
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
packageName: live.iqfareez.waktusolatmalaysia
releaseFiles: "*.aab"
track: production
status: draft
- name: Adding markdown
run: |
echo ":rocket: Uploaded to Google Play" >> $GITHUB_STEP_SUMMARY