-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (90 loc) · 2.83 KB
/
ci.yml
File metadata and controls
102 lines (90 loc) · 2.83 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
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
name: ProductVoiceCode CI
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
# JOB 1: LINT & TEST
test:
name: Lint & Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: Install Dependencies
run: npm install
- name: Run Lint
run: npm run lint
- name: Run Unit Tests
run: npm test
# JOB 2: BUILD ANDROID
build-android:
name: Build Android
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Install Dependencies
run: npm install
# Decode Keystore
- name: Decode Keystore
env:
ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}
run: |
echo $ANDROID_KEYSTORE_B64 | base64 -d > android/app/my-upload-key.keystore
# Build Android Release
- name: Build Android Release
run: |
cd android
./gradlew bundleRelease \
-PMYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore \
-PMYAPP_UPLOAD_KEY_ALIAS=my-key-alias \
-PMYAPP_UPLOAD_STORE_PASSWORD=${{ secrets.ANDROID_KEYSTORE_PASSWORD }} \
-PMYAPP_UPLOAD_KEY_PASSWORD=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: android-release.aab
path: android/app/build/outputs/bundle/release/app-release.aab
# JOB 3: BUILD iOS
build-ios:
name: Build iOS
needs: test
# CRITICAL FIX: Use macos-13 (Xcode 15) for RN 0.72 compatibility
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: Install Dependencies
run: npm install
# Fix Boost URL (The default one is broken)
- name: Fix Boost URL
run: |
sed -i '' 's|https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2|https://archives.boost.io/release/1.76.0/source/boost_1_76_0.tar.bz2|g' node_modules/react-native/third-party-podspecs/boost.podspec
- name: Install Pods
run: |
cd ios
pod install
- name: Build iOS (Debug)
run: |
cd ios
xcodebuild -workspace ProductVoiceCode.xcworkspace -scheme ProductVoiceCode -configuration Debug -sdk iphonesimulator -derivedDataPath build -quiet