Skip to content

Commit 9d3f2cf

Browse files
committed
build: expo on the CI
1 parent d963c6f commit 9d3f2cf

File tree

5 files changed

+1550
-726
lines changed

5 files changed

+1550
-726
lines changed

.github/workflows/ci.yml

Lines changed: 201 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,192 @@ 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 }}"
339+
340+
341+
build-tvos-expo:
342+
runs-on: macos-15
343+
env:
344+
TURBO_CACHE_DIR: .turbo/ios-expo
345+
steps:
346+
- name: Checkout
347+
uses: actions/checkout@v3
348+
349+
- name: Setup
350+
uses: ./.github/actions/setup
351+
352+
- name: Build package
353+
run: yarn prepare
354+
355+
- name: Cache turborepo for iOS
356+
uses: actions/cache@v3
357+
with:
358+
path: ${{ env.TURBO_CACHE_DIR }}
359+
key: ${{ runner.os }}-turborepo-expo-tvos--${{ hashFiles('yarn.lock') }}
360+
restore-keys: |
361+
${{ runner.os }}-turborepo-expo-tvos-
362+
363+
- name: Check turborepo cache for iOS
364+
run: |
365+
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:tvos-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:tvos-expo').cache.status")
366+
367+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
368+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
369+
fi
370+
371+
- name: Build example for tvOS
372+
run: |
373+
yarn turbo run build:tvos-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}"
374+
375+
376+
build-androidtv-expo:
377+
runs-on: ubuntu-latest
378+
env:
379+
TURBO_CACHE_DIR: .turbo/android
380+
steps:
381+
- name: Checkout
382+
uses: actions/checkout@v3
383+
384+
- name: Setup
385+
uses: ./.github/actions/setup
386+
387+
- name: Build package
388+
run: yarn prepare
389+
390+
- name: Cache turborepo for Android
391+
uses: actions/cache@v3
392+
with:
393+
path: ${{ env.TURBO_CACHE_DIR }}
394+
key: ${{ runner.os }}-turborepo-expo-androidtv-${{ hashFiles('yarn.lock') }}
395+
restore-keys: |
396+
${{ runner.os }}-turborepo-expo-androidtv-
397+
398+
- name: Check turborepo cache for Android TV
399+
run: |
400+
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:androidtv-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:androidtv-expo').cache.status")
401+
402+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
403+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
404+
fi
405+
406+
- name: Install JDK
407+
if: env.turbo_cache_hit != 1
408+
uses: actions/setup-java@v3
409+
with:
410+
distribution: 'zulu'
411+
java-version: '17'
412+
413+
- name: Finalize Android SDK
414+
if: env.turbo_cache_hit != 1
415+
run: |
416+
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
417+
418+
- name: Cache Gradle
419+
if: env.turbo_cache_hit != 1
420+
uses: actions/cache@v3
421+
with:
422+
path: |
423+
~/.gradle/wrapper
424+
~/.gradle/caches
425+
key: ${{ runner.os }}-gradle-${{ hashFiles('apps/example/android/gradle/wrapper/gradle-wrapper.properties') }}
426+
restore-keys: |
427+
${{ runner.os }}-gradle-
428+
429+
- name: Build example for Android TV
430+
env:
431+
JAVA_OPTS: "-XX:MaxHeapSize=6g"
432+
run: |
433+
yarn turbo run build:androidtv-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}"

apps/example-expo/app.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"plugins": [
2828
"expo-router",
2929
"react-native-bottom-tabs",
30+
"@react-native-tvos/config-tv",
3031
[
3132
"expo-splash-screen",
3233
{
@@ -43,7 +44,8 @@
4344
"useFrameworks": "static"
4445
}
4546
}
46-
]
47+
],
48+
"expo-font"
4749
],
4850
"experiments": {
4951
"typedRoutes": true

apps/example-expo/package.json

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"scripts": {
77
"start": "expo start",
88
"reset-project": "node ./scripts/reset-project.js",
9+
"build:android-expo": "expo prebuild --clean --platform android && && cd android && ./gradlew assembleRelease",
10+
"build:ios-expo": "expo prebuild --clean --platform ios && expo run:ios",
11+
"build:androidtv-expo": "export EXPO_TV=1 && expo prebuild --clean --platform android && cd android && ./gradlew assembleRelease",
12+
"build:tvos-expo": "export EXPO_TV=1 && expo prebuild --clean --platform ios && expo run:ios",
913
"android": "expo run:android",
1014
"ios": "expo run:ios",
1115
"web": "expo start --web",
@@ -19,38 +23,39 @@
1923
"@expo/vector-icons": "^14.0.2",
2024
"@react-navigation/bottom-tabs": "^6.1.18",
2125
"@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",
26+
"expo": "~51.0.39",
27+
"expo-build-properties": "~0.12.5",
28+
"expo-constants": "~16.0.2",
29+
"expo-font": "~12.0.10",
30+
"expo-linking": "~6.3.1",
2731
"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",
32+
"expo-splash-screen": "~0.27.7",
33+
"expo-status-bar": "~1.12.1",
34+
"expo-symbols": "~0.1.5",
35+
"expo-system-ui": "~3.0.7",
36+
"expo-web-browser": "~13.0.3",
37+
"react": "18.2.0",
38+
"react-dom": "18.2.0",
39+
"react-native": "npm:react-native-tvos@^0.74.5-0",
3640
"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",
41+
"react-native-gesture-handler": "~2.16.1",
42+
"react-native-reanimated": "~3.10.1",
43+
"react-native-safe-area-context": "4.10.5",
44+
"react-native-screens": "3.31.1",
4145
"react-native-web": "~0.19.13",
42-
"react-native-webview": "13.12.2"
46+
"react-native-webview": "13.8.6"
4347
},
4448
"devDependencies": {
4549
"@babel/core": "^7.25.2",
46-
"@react-native/metro-config": "^0.76.2",
50+
"@react-native-tvos/config-tv": "^0.1.0",
51+
"@react-native/metro-config": "^0.75.4",
4752
"@types/jest": "^29.5.12",
48-
"@types/react": "~18.3.12",
53+
"@types/react": "~18.2.79",
4954
"@types/react-test-renderer": "^18.3.0",
5055
"babel-plugin-module-resolver": "^5.0.2",
5156
"jest": "^29.2.1",
52-
"jest-expo": "~52.0.1",
57+
"jest-expo": "~51.0.4",
5358
"react-test-renderer": "18.3.1",
54-
"typescript": "^5.3.3"
59+
"typescript": "~5.3.3"
5560
}
5661
}

turbo.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,30 @@
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+
},
56+
"build:androidtv-expo": {
57+
"env": ["JAVA_HOME", "ANDROID_NDK", "ANDROID_SDK", "ANDROID_HOME"],
58+
"inputs": [
59+
"packages/react-native-bottom-tabs/package.json",
60+
"packages/react-native-bottom-tabs/android",
61+
"packages/react-native-bottom-tabs/!android/build",
62+
"packages/react-native-bottom-tabs/src/*.ts",
63+
"packages/react-native-bottom-tabs/src/*.tsx",
64+
"apps/example-expo/package.json"
65+
],
66+
"outputs": []
67+
},
4468
"build:ios": {
4569
"env": ["RCT_NEW_ARCH_ENABLED"],
4670
"inputs": [
@@ -55,6 +79,30 @@
5579
"!apps/example/ios/Pods"
5680
],
5781
"outputs": []
82+
},
83+
"build:ios-expo": {
84+
"env": ["RCT_NEW_ARCH_ENABLED"],
85+
"inputs": [
86+
"packages/*/package.json",
87+
"packages/*/*.podspec",
88+
"packages/*/ios",
89+
"packages/*/src/*.ts",
90+
"packages/*/src/*.tsx",
91+
"apps/example-expo/package.json"
92+
],
93+
"outputs": []
94+
},
95+
"build:tvos-expo": {
96+
"env": ["RCT_NEW_ARCH_ENABLED"],
97+
"inputs": [
98+
"packages/*/package.json",
99+
"packages/*/*.podspec",
100+
"packages/*/ios",
101+
"packages/*/src/*.ts",
102+
"packages/*/src/*.tsx",
103+
"apps/example-expo/package.json"
104+
],
105+
"outputs": []
58106
}
59107
}
60108
}

0 commit comments

Comments
 (0)