-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (74 loc) · 2.44 KB
/
build-android-release.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
name: Build Android App Release
on:
push:
branches:
- main
jobs:
build_aab:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install NPM Packages
working-directory: app
run: npm i
- name: Decode and save the keystore file
working-directory: app/android/app
run: |
echo "${{ secrets.ANDROID_UPLOAD_KEYSTORE_FILE_BASE64 }}" | base64 --decode > my-upload-key.keystore
- name: Build Android App AAB
working-directory: app/android
run: ./gradlew bundleRelease
env:
KEYSTORE_FILE: my-upload-key.keystore
KEYSTORE_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_ALIAS }}
KEY_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_KEY_PASSWORD }}
- name: Upload AAB
uses: actions/upload-artifact@v4
with:
name: app-release.aab
path: app/android/app/build/outputs/bundle/release/app-release.aab
build_apk:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install NPM Packages
working-directory: app
run: npm i
- name: Decode and save the keystore file
working-directory: app/android/app
run: |
echo "${{ secrets.ANDROID_UPLOAD_KEYSTORE_FILE_BASE64 }}" | base64 --decode > my-upload-key.keystore
- name: Build Android App APK
working-directory: app/android
run: ./gradlew assembleRelease
env:
KEYSTORE_FILE: my-upload-key.keystore
KEYSTORE_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_ALIAS }}
KEY_PASSWORD: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_KEY_PASSWORD }}
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app-release.apk
path: app/android/app/build/outputs/apk/release/app-release.apk