Skip to content

Commit 367f598

Browse files
committed
build: expo on the CI
1 parent d963c6f commit 367f598

File tree

11 files changed

+1487
-1513
lines changed

11 files changed

+1487
-1513
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"icon": "./assets/images/icon.png",
88
"scheme": "myapp",
99
"userInterfaceStyle": "automatic",
10-
"newArchEnabled": true,
1110
"ios": {
1211
"supportsTablet": true,
1312
"bundleIdentifier": "com.anonymous.bottomtabs"
@@ -40,10 +39,12 @@
4039
"expo-build-properties",
4140
{
4241
"ios": {
42+
"deploymentTarget": "14.0",
4343
"useFrameworks": "static"
4444
}
4545
}
46-
]
46+
],
47+
"expo-font"
4748
],
4849
"experiments": {
4950
"typedRoutes": true

apps/example-expo/app/(tabs)/explore.tsx

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
1-
import { StyleSheet, Image, Platform } from 'react-native';
1+
import { StyleSheet, Image } from 'react-native';
22

33
import { Collapsible } from '@/components/Collapsible';
44
import { ExternalLink } from '@/components/ExternalLink';
5-
import ParallaxScrollView from '@/components/ParallaxScrollView';
65
import { ThemedText } from '@/components/ThemedText';
76
import { ThemedView } from '@/components/ThemedView';
8-
import { IconSymbol } from '@/components/ui/IconSymbol';
7+
import { ScrollView } from 'react-native-gesture-handler';
98

109
function TabTwoScreen() {
1110
return (
12-
<ParallaxScrollView
13-
headerBackgroundColor={{ light: '#D0D0D0', dark: '#353636' }}
14-
headerImage={
15-
<IconSymbol
16-
size={310}
17-
color="#808080"
18-
name="chevron.left.forwardslash.chevron.right"
19-
style={styles.headerImage}
20-
/>
21-
}
22-
>
11+
<ScrollView>
2312
<ThemedView style={styles.titleContainer}>
2413
<ThemedText type="title">Explore</ThemedText>
2514
</ThemedView>
@@ -87,31 +76,7 @@ function TabTwoScreen() {
8776
<ThemedText type="link">Learn more</ThemedText>
8877
</ExternalLink>
8978
</Collapsible>
90-
<Collapsible title="Animations">
91-
<ThemedText>
92-
This template includes an example of an animated component. The{' '}
93-
<ThemedText type="defaultSemiBold">
94-
components/HelloWave.tsx
95-
</ThemedText>{' '}
96-
component uses the powerful{' '}
97-
<ThemedText type="defaultSemiBold">
98-
react-native-reanimated
99-
</ThemedText>{' '}
100-
library to create a waving hand animation.
101-
</ThemedText>
102-
{Platform.select({
103-
ios: (
104-
<ThemedText>
105-
The{' '}
106-
<ThemedText type="defaultSemiBold">
107-
components/ParallaxScrollView.tsx
108-
</ThemedText>{' '}
109-
component provides a parallax effect for the header image.
110-
</ThemedText>
111-
),
112-
})}
113-
</Collapsible>
114-
</ParallaxScrollView>
79+
</ScrollView>
11580
);
11681
}
11782

apps/example-expo/app/(tabs)/index.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
1-
import { Image, StyleSheet, Platform } from 'react-native';
1+
import { ScrollView, StyleSheet, Platform } from 'react-native';
22

3-
import { HelloWave } from '@/components/HelloWave';
4-
import ParallaxScrollView from '@/components/ParallaxScrollView';
53
import { ThemedText } from '@/components/ThemedText';
64
import { ThemedView } from '@/components/ThemedView';
75

86
function HomeScreen() {
97
return (
10-
<ParallaxScrollView
11-
headerBackgroundColor={{ light: '#A1CEDC', dark: '#1D3D47' }}
12-
headerImage={
13-
<Image
14-
source={require('@/assets/images/partial-react-logo.png')}
15-
style={styles.reactLogo}
16-
/>
17-
}
18-
>
8+
<ScrollView>
199
<ThemedView style={styles.titleContainer}>
2010
<ThemedText type="title">Welcome!</ThemedText>
21-
<HelloWave />
2211
</ThemedView>
2312
<ThemedView style={styles.stepContainer}>
2413
<ThemedText type="subtitle">Step 1: Try it</ThemedText>
@@ -54,7 +43,7 @@ function HomeScreen() {
5443
<ThemedText type="defaultSemiBold">app-example</ThemedText>.
5544
</ThemedText>
5645
</ThemedView>
57-
</ParallaxScrollView>
46+
</ScrollView>
5847
);
5948
}
6049

apps/example-expo/babel.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const pak = require('../../packages/react-native-bottom-tabs/package.json');
44
module.exports = {
55
presets: ['babel-preset-expo'],
66
plugins: [
7-
'react-native-reanimated/plugin',
87
[
98
'module-resolver',
109
{

apps/example-expo/components/HelloWave.tsx

Lines changed: 0 additions & 40 deletions
This file was deleted.

apps/example-expo/components/ParallaxScrollView.tsx

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)