Skip to content

Commit 01feffd

Browse files
committed
build: expo on the CI
1 parent d963c6f commit 01feffd

File tree

5 files changed

+1425
-736
lines changed

5 files changed

+1425
-736
lines changed

.github/workflows/ci.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
- name: Setup
5151
uses: ./.github/actions/setup
5252

53+
- name: Build package
54+
run: yarn prepare
55+
5356
- name: Cache turborepo for Android
5457
uses: actions/cache@v3
5558
with:
@@ -106,6 +109,9 @@ jobs:
106109
- name: Setup
107110
uses: ./.github/actions/setup
108111

112+
- name: Build package
113+
run: yarn prepare
114+
109115
- name: Cache turborepo for Android new arch
110116
uses: actions/cache@v3
111117
with:
@@ -162,6 +168,9 @@ jobs:
162168
- name: Setup
163169
uses: ./.github/actions/setup
164170

171+
- name: Build package
172+
run: yarn prepare
173+
165174
- name: Cache turborepo for iOS
166175
uses: actions/cache@v3
167176
with:
@@ -202,6 +211,9 @@ jobs:
202211
- name: Setup
203212
uses: ./.github/actions/setup
204213

214+
- name: Build package
215+
run: yarn prepare
216+
205217
- name: Cache turborepo for iOS
206218
uses: actions/cache@v3
207219
with:
@@ -230,3 +242,97 @@ jobs:
230242
- name: Build example for iOS
231243
run: |
232244
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
245+
246+
build-ios-expo:
247+
runs-on: macos-15
248+
env:
249+
TURBO_CACHE_DIR: .turbo/ios-expo
250+
steps:
251+
- name: Checkout
252+
uses: actions/checkout@v3
253+
254+
- name: Setup
255+
uses: ./.github/actions/setup
256+
257+
- name: Build package
258+
run: yarn prepare
259+
260+
- name: Cache turborepo for iOS
261+
uses: actions/cache@v3
262+
with:
263+
path: ${{ env.TURBO_CACHE_DIR }}
264+
key: ${{ runner.os }}-turborepo-expo-ios--${{ hashFiles('yarn.lock') }}
265+
restore-keys: |
266+
${{ runner.os }}-turborepo-expo-ios-
267+
268+
- name: Check turborepo cache for iOS
269+
run: |
270+
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios-expo').cache.status")
271+
272+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
273+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
274+
fi
275+
276+
- name: Build example for iOS
277+
run: |
278+
yarn turbo run build:ios-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}"
279+
280+
281+
build-android-expo:
282+
runs-on: ubuntu-latest
283+
env:
284+
TURBO_CACHE_DIR: .turbo/android
285+
steps:
286+
- name: Checkout
287+
uses: actions/checkout@v3
288+
289+
- name: Setup
290+
uses: ./.github/actions/setup
291+
292+
- name: Build package
293+
run: yarn prepare
294+
295+
- name: Cache turborepo for Android
296+
uses: actions/cache@v3
297+
with:
298+
path: ${{ env.TURBO_CACHE_DIR }}
299+
key: ${{ runner.os }}-turborepo-expo-android-${{ hashFiles('yarn.lock') }}
300+
restore-keys: |
301+
${{ runner.os }}-turborepo-expo-android-
302+
303+
- name: Check turborepo cache for Android
304+
run: |
305+
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android-expo').cache.status")
306+
307+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
308+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
309+
fi
310+
311+
- name: Install JDK
312+
if: env.turbo_cache_hit != 1
313+
uses: actions/setup-java@v3
314+
with:
315+
distribution: 'zulu'
316+
java-version: '17'
317+
318+
- name: Finalize Android SDK
319+
if: env.turbo_cache_hit != 1
320+
run: |
321+
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
322+
323+
- name: Cache Gradle
324+
if: env.turbo_cache_hit != 1
325+
uses: actions/cache@v3
326+
with:
327+
path: |
328+
~/.gradle/wrapper
329+
~/.gradle/caches
330+
key: ${{ runner.os }}-gradle-${{ hashFiles('apps/example/android/gradle/wrapper/gradle-wrapper.properties') }}
331+
restore-keys: |
332+
${{ runner.os }}-gradle-
333+
334+
- name: Build example for Android
335+
env:
336+
JAVA_OPTS: "-XX:MaxHeapSize=6g"
337+
run: |
338+
yarn turbo run build:android-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}"

apps/example-expo/app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"useFrameworks": "static"
4444
}
4545
}
46-
]
46+
],
47+
"expo-font"
4748
],
4849
"experiments": {
4950
"typedRoutes": true

apps/example-expo/package.json

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"scripts": {
77
"start": "expo start",
88
"reset-project": "node ./scripts/reset-project.js",
9+
"build:android-expo": "expo prebuild --clean --platform android && expo run:android",
10+
"build:ios-expo": "expo prebuild --clean --platform ios && expo run:ios",
911
"android": "expo run:android",
1012
"ios": "expo run:ios",
1113
"web": "expo start --web",
@@ -19,38 +21,38 @@
1921
"@expo/vector-icons": "^14.0.2",
2022
"@react-navigation/bottom-tabs": "^6.1.18",
2123
"@react-navigation/native": "^6.1.18",
22-
"expo": "~52.0.7",
23-
"expo-build-properties": "^0.13.1",
24-
"expo-constants": "~17.0.3",
25-
"expo-font": "~13.0.1",
26-
"expo-linking": "~7.0.2",
24+
"expo": "~51.0.39",
25+
"expo-build-properties": "~0.12.5",
26+
"expo-constants": "~16.0.2",
27+
"expo-font": "~12.0.10",
28+
"expo-linking": "~6.3.1",
2729
"expo-router": "~3.5.24",
28-
"expo-splash-screen": "~0.29.9",
29-
"expo-status-bar": "~2.0.0",
30-
"expo-symbols": "~0.2.0",
31-
"expo-system-ui": "~4.0.2",
32-
"expo-web-browser": "~14.0.1",
33-
"react": "18.3.1",
34-
"react-dom": "18.3.1",
35-
"react-native": "0.76.2",
30+
"expo-splash-screen": "~0.27.7",
31+
"expo-status-bar": "~1.12.1",
32+
"expo-symbols": "~0.1.5",
33+
"expo-system-ui": "~3.0.7",
34+
"expo-web-browser": "~13.0.3",
35+
"react": "18.2.0",
36+
"react-dom": "18.2.0",
37+
"react-native": "0.74.5",
3638
"react-native-bottom-tabs": "*",
37-
"react-native-gesture-handler": "~2.20.2",
38-
"react-native-reanimated": "~3.16.1",
39-
"react-native-safe-area-context": "4.12.0",
40-
"react-native-screens": "~4.0.0",
39+
"react-native-gesture-handler": "~2.16.1",
40+
"react-native-reanimated": "~3.10.1",
41+
"react-native-safe-area-context": "4.10.5",
42+
"react-native-screens": "3.31.1",
4143
"react-native-web": "~0.19.13",
42-
"react-native-webview": "13.12.2"
44+
"react-native-webview": "13.8.6"
4345
},
4446
"devDependencies": {
4547
"@babel/core": "^7.25.2",
46-
"@react-native/metro-config": "^0.76.2",
48+
"@react-native/metro-config": "^0.75.4",
4749
"@types/jest": "^29.5.12",
48-
"@types/react": "~18.3.12",
50+
"@types/react": "~18.2.79",
4951
"@types/react-test-renderer": "^18.3.0",
5052
"babel-plugin-module-resolver": "^5.0.2",
5153
"jest": "^29.2.1",
52-
"jest-expo": "~52.0.1",
54+
"jest-expo": "~51.0.4",
5355
"react-test-renderer": "18.3.1",
54-
"typescript": "^5.3.3"
56+
"typescript": "~5.3.3"
5557
}
5658
}

turbo.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@
4141
],
4242
"outputs": []
4343
},
44+
"build:android-expo": {
45+
"env": ["JAVA_HOME", "ANDROID_NDK", "ANDROID_SDK", "ANDROID_HOME"],
46+
"inputs": [
47+
"packages/react-native-bottom-tabs/package.json",
48+
"packages/react-native-bottom-tabs/android",
49+
"packages/react-native-bottom-tabs/!android/build",
50+
"packages/react-native-bottom-tabs/src/*.ts",
51+
"packages/react-native-bottom-tabs/src/*.tsx",
52+
"apps/example-expo/package.json"
53+
],
54+
"outputs": []
55+
},
4456
"build:ios": {
4557
"env": ["RCT_NEW_ARCH_ENABLED"],
4658
"inputs": [
@@ -55,6 +67,18 @@
5567
"!apps/example/ios/Pods"
5668
],
5769
"outputs": []
70+
},
71+
"build:ios-expo": {
72+
"env": ["RCT_NEW_ARCH_ENABLED"],
73+
"inputs": [
74+
"packages/*/package.json",
75+
"packages/*/*.podspec",
76+
"packages/*/ios",
77+
"packages/*/src/*.ts",
78+
"packages/*/src/*.tsx",
79+
"apps/example-expo/package.json"
80+
],
81+
"outputs": []
5882
}
5983
}
6084
}

0 commit comments

Comments
 (0)