-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (97 loc) · 3 KB
/
build.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
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
- name: Cache node_modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- run: npm ci
- run: npx turbo build
prebuild:
needs: []
runs-on: ${{ matrix.os }}
strategy:
matrix:
platform: [android, ios]
include:
- os: ubuntu-latest
platform: android
- os: macos-latest
platform: ios
steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
- name: Cache node_modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Write google-services.json
run: 'printenv GOOGLE_SERVICES_JSON > ./google-services.json'
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
- name: Verify google-services.json
run: |
jq -e '.project_info.project_id == "trajano"' ./google-services.json > /dev/null
- name: Install dependencies
run: npm install
- name: Prebuild for ${{ matrix.platform }}
run: npx expo prebuild --platform ${{ matrix.platform }}
working-directory: packages/my-app
- name: Set up JDK 17
if: matrix.platform == 'android'
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
- name: Build Android App
if: matrix.platform == 'android'
run: ./gradlew assembleDebug
working-directory: packages/my-app/android
env:
GRADLE_OPTS: -Xmx4g
JAVA_OPTS: -Xmx4g
- name: Cache CocoaPods
uses: actions/cache@v4
with:
path: |
Pods
~/Library/Caches/CocoaPods
key: ${{ runner.os }}-pods-${{ hashFiles('Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
if: matrix.platform == 'ios'
- name: CocoaPods Install
if: matrix.platform == 'ios'
run: |
pod install
working-directory: packages/my-app/ios
- name: Build iOS App
if: matrix.platform == 'ios'
run: |
source .xcode.env
xcodebuild -workspace MyAppGo.xcworkspace -scheme MyAppGo -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' build
working-directory: packages/my-app/ios