Skip to content

Commit a4450d2

Browse files
authored
ci: build new architecture for mixed templates (#614)
1 parent 8edf590 commit a4450d2

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

.github/workflows/build-templates.yml

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
language:
4040
- kotlin-objc
4141
- kotlin-swift
42+
arch:
43+
- auto
4244
exclude:
4345
- type: module-new
4446
language: kotlin-swift
@@ -52,27 +54,50 @@ jobs:
5254
- os: ubuntu-latest
5355
type: library
5456
language: js
57+
arch: auto
58+
- os: ubuntu-latest
59+
type: module-mixed
60+
language: kotlin-objc
61+
arch: new
62+
- os: macos-14
63+
type: module-mixed
64+
language: kotlin-objc
65+
arch: new
66+
- os: ubuntu-latest
67+
type: view-mixed
68+
language: kotlin-objc
69+
arch: new
70+
- os: macos-14
71+
type: view-mixed
72+
language: kotlin-objc
73+
arch: new
5574
- os: ubuntu-latest
5675
type: module-legacy
5776
language: cpp
77+
arch: auto
5878
- os: ubuntu-latest
5979
type: module-mixed
6080
language: cpp
81+
arch: auto
6182
- os: ubuntu-latest
6283
type: module-new
6384
language: cpp
85+
arch: auto
6486
- os: macos-14
6587
type: module-legacy
6688
language: cpp
89+
arch: auto
6790
- os: macos-14
6891
type: module-mixed
6992
language: cpp
93+
arch: auto
7094
- os: macos-14
7195
type: module-new
7296
language: cpp
97+
arch: auto
7398

7499
concurrency:
75-
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}
100+
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}
76101
cancel-in-progress: true
77102

78103
runs-on: ${{ matrix.os }}
@@ -84,13 +109,20 @@ jobs:
84109
- name: Setup
85110
uses: ./.github/actions/setup
86111

112+
- name: Set environment variables
113+
run: |
114+
if [[ "${{ matrix.arch }}" == "new" ]]; then
115+
echo "RCT_NEW_ARCH_ENABLED=1" >> $GITHUB_ENV
116+
echo "ORG_GRADLE_PROJECT_newArchEnabled=true" >> $GITHUB_ENV
117+
fi
118+
87119
- name: Build package
88120
run: |
89121
yarn workspace create-react-native-library prepare
90122
91123
- name: Get working directory
92124
run: |
93-
echo "work_dir=${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}" >> $GITHUB_ENV
125+
echo "work_dir=${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}" >> $GITHUB_ENV
94126
95127
- name: Create library
96128
run: |
@@ -158,9 +190,9 @@ jobs:
158190
with:
159191
path: |
160192
${{ env.work_dir }}/.turbo
161-
key: ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ hashFiles(format('{0}/yarn.lock', env.work_dir)) }}
193+
key: ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}-${{ hashFiles(format('{0}/yarn.lock', env.work_dir)) }}
162194
restore-keys: |
163-
${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-
195+
${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}-
164196
165197
- name: Check turborepo cache
166198
if: env.android_build == 1 || env.ios_build == 1
@@ -248,13 +280,13 @@ jobs:
248280
${{ runner.os }}-library-cocoapods-
249281
250282
- name: Install cocoapods
283+
env:
284+
NO_FLIPPER: 1
251285
if: env.ios_build == 1 && env.turbo_cache_hit_ios != 1 && steps.library-cocoapods-cache.outputs.cache-hit != 'true'
252286
working-directory: ${{ env.work_dir }}
253287
run: |
254288
cd example/ios
255289
pod install
256-
env:
257-
NO_FLIPPER: 1
258290
259291
- name: Build example (iOS)
260292
if: env.ios_build == 1

packages/create-react-native-library/templates/native-common-example/turbo.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"pipeline": {
44
<% if (example !== 'expo') { -%>
55
"build:android": {
6+
"env": ["ORG_GRADLE_PROJECT_newArchEnabled"],
67
"inputs": [
78
"package.json",
89
"android",
@@ -18,6 +19,7 @@
1819
"outputs": []
1920
},
2021
"build:ios": {
22+
"env": ["RCT_NEW_ARCH_ENABLED"],
2123
"inputs": [
2224
"package.json",
2325
"*.podspec",

0 commit comments

Comments
 (0)