Skip to content

Commit 1cb5a12

Browse files
committed
Update build android
1 parent e3be7fb commit 1cb5a12

File tree

1 file changed

+29
-83
lines changed

1 file changed

+29
-83
lines changed

.github/workflows/test.yml

+29-83
Original file line numberDiff line numberDiff line change
@@ -66,105 +66,51 @@ jobs:
6666
cd ..
6767
xcodebuild -workspace ios/RNExternalDisplayExample.xcworkspace -scheme RNExternalDisplayExample -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build
6868
69-
test-ios-oldarch:
70-
runs-on: macOS-latest
71-
steps:
72-
- uses: actions/checkout@v4
73-
- uses: actions/[email protected]
74-
with:
75-
node-version: 18.x
76-
- name: Get yarn cache directory path
77-
id: yarn-cache-dir-path
78-
run: echo "::set-output name=dir::$(yarn cache dir)"
79-
- uses: actions/cache@v4
80-
id: yarn-cache
81-
with:
82-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
83-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
84-
restore-keys: |
85-
${{ runner.os }}-yarn-
86-
- name: Cache pods
87-
uses: actions/cache@v4
88-
with:
89-
path: |
90-
packages/RNExternalDisplayExample/ios/Pods
91-
packages/RNExternalDisplayExample/ios/build
92-
key: ${{ runner.os }}-pods-oldarch-${{ hashFiles('**/RNExternalDisplayExample/ios/Podfile.lock') }}
93-
restore-keys: |
94-
${{ runner.os }}-pods-oldarch-
95-
- name: Install deps
96-
run: yarn
97-
- name: Build RNExternalDisplayExample
98-
env:
99-
RCT_NEW_ARCH_ENABLED: 0
100-
run: |
101-
cd packages/RNExternalDisplayExample/ios
102-
pod repo update
103-
pod install
104-
cd ..
105-
xcodebuild -workspace ios/RNExternalDisplayExample.xcworkspace -scheme RNExternalDisplayExample -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build
106-
107-
test-android-newarch:
69+
build-android:
10870
runs-on: ubuntu-latest
71+
10972
steps:
110-
- uses: actions/checkout@v4
111-
- uses: actions/[email protected]
73+
# Checkout the code
74+
- name: Checkout the code
75+
uses: actions/checkout@v4
76+
77+
# Set up Node.js environment
78+
- name: Set up Node.js
79+
uses: actions/[email protected]
11280
with:
11381
node-version: 18.x
114-
- name: Get yarn cache directory path
115-
id: yarn-cache-dir-path
116-
run: echo "::set-output name=dir::$(yarn cache dir)"
117-
- uses: actions/cache@v4
118-
id: yarn-cache
119-
with:
120-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
121-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
122-
restore-keys: |
123-
${{ runner.os }}-yarn-
124-
- name: Install Java
82+
83+
# Install Java 17
84+
- name: Set up Java 17
12585
uses: actions/setup-java@v4
12686
with:
127-
distribution: zulu
128-
java-version: 17
129-
# - name: Setup Android Emulator
130-
# run: |
131-
# $ANDROID_HOME/tools/bin/sdkmanager --install emulator
132-
# $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-28;google_apis;x86"
133-
# echo no | $ANDROID_HOME/tools/bin/avdmanager create avd --force -n Test -k "system-images;android-28;google_apis;x86"
134-
# $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window &
135-
- name: Install deps
136-
run: yarn
137-
- name: Build RNExternalDisplayExample
138-
run: |
139-
cd packages/RNExternalDisplayExample/android
140-
./gradlew assemblerelease
87+
distribution: 'temurin'
88+
java-version: '17'
14189

142-
test-android-oldarch:
143-
runs-on: ubuntu-latest
144-
steps:
145-
- uses: actions/checkout@v4
146-
- uses: actions/[email protected]
147-
with:
148-
node-version: 18.x
90+
# Cache Yarn dependencies to speed up the build
14991
- name: Get yarn cache directory path
15092
id: yarn-cache-dir-path
15193
run: echo "::set-output name=dir::$(yarn cache dir)"
94+
15295
- uses: actions/cache@v4
15396
id: yarn-cache
15497
with:
15598
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
15699
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
157100
restore-keys: |
158101
${{ runner.os }}-yarn-
159-
- name: Install Java
160-
uses: actions/setup-java@v4
161-
with:
162-
distribution: zulu
163-
java-version: 17
164-
- name: Install deps
102+
103+
# Install dependencies
104+
- name: Install dependencies
165105
run: yarn
166-
- name: Build RNExternalDisplayExample
106+
107+
# Prebuild the Android folder for Expo
108+
- name: Prebuild Android with Expo
109+
working-directory: apps/external-display-example
167110
run: |
168-
cd packages/RNExternalDisplayExample/android
169-
sed -i 's/newArchEnabled=true/newArchEnabled=false/g' gradle.properties
170-
./gradlew assemblerelease
111+
yarn expo prebuild --platform android
112+
113+
# Build the APK without running on a device
114+
- name: Build Android APK
115+
working-directory: apps/external-display-example/android
116+
run: ./gradlew assembleDebug

0 commit comments

Comments
 (0)