-
Notifications
You must be signed in to change notification settings - Fork 9
59 lines (55 loc) · 1.8 KB
/
mobile.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
name: Build Android and iOS mobile app
on:
push:
branches:
- main
jobs:
react-native-android-build-apk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
java-version: '20'
distribution: 'temurin'
cache: gradle
- name: Cache node modules
uses: actions/cache@v2
with:
path: mobile/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm dependencies
run: |
cd mobile && npm install
cd nodejs-assets/nodejs-project && npm install
- name: Cache Gradle Wrapper and Caches
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set execute permission for gradlew
run: |
chmod +x ./mobile/android/gradlew # Ensuring gradlew has execute permissions
- name: Build Android Release
run: |
cd mobile/android && ./gradlew assembleRelease
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: Android-APKs
path: mobile/android/app/build/outputs/apk/release/*.apk
- name: Upload APKs to Server
env:
TOKEN: ${{ secrets.TOKEN }}
UPLOAD_URL: ${{ secrets.UPLOAD_URL }}
run: |
for apk in mobile/android/app/build/outputs/apk/release/*.apk; do
curl -F "file=@$apk" $UPLOAD_URL?token=$TOKEN
done