Skip to content

Commit 5b44d40

Browse files
committed
ci: simplify Android and iOS workflows to build only new architecture
Add a dedicated Android "new architecture" job with standard steps (checkout, setup-node, install deps, codegen, setup JDK 17, cache Gradle, assemble debug). Remove matrix-based builds and the conditional sed steps that toggled the new architecture in gradle.properties and Podfile for both Android and iOS.
1 parent 9c82e81 commit 5b44d40

File tree

2 files changed

+78
-13
lines changed

2 files changed

+78
-13
lines changed

.github/workflows/android-build.yml

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,83 @@ concurrency:
3434
group: ${{ github.workflow }}-${{ github.ref }}
3535
cancel-in-progress: true
3636

37+
jobs:
38+
build:
39+
name: Build Android Example App (New Architecture)
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- uses: actions/setup-node@v4
46+
with:
47+
node-version: '22'
48+
cache: yarn
49+
50+
- name: Install dependencies (yarn)
51+
run: yarn install --frozen-lockfile
52+
53+
- name: Install example dependencies (yarn)
54+
run: cd example && yarn install --frozen-lockfile
55+
56+
- name: Generate Nitro modules (codegen)
57+
run: yarn codegen
58+
59+
- name: Setup JDK 17
60+
uses: actions/setup-java@v5
61+
with:
62+
distribution: zulu
63+
java-version: '17'
64+
cache: gradle
65+
66+
- name: Cache Gradle
67+
uses: actions/cache@v4
68+
with:
69+
path: |
70+
~/.gradle/caches
71+
~/.gradle/wrapper
72+
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/**/*.gradle*') }}
73+
restore-keys: |
74+
${{ runner.os }}-gradle-
75+
76+
- name: Run Gradle build
77+
working-directory: example/android
78+
run: ./gradlew assembleDebug --no-daemon --build-cache
79+
80+
- name: Stop Gradle daemon
81+
working-directory: example/android
82+
run: ./gradlew --stopname: Build Android
83+
84+
permissions:
85+
contents: read
86+
87+
jobs:
88+
build:
89+
name: Build Android Example App (New Architecture)
90+
runs-on: ubuntu-latest
91+
- 'nitrogen/generated/android/**'
92+
- 'cpp/**'
93+
- 'android/**'
94+
- '**/yarn.lock'
95+
- '**/react-native.config.js'
96+
- '**/nitro.json'
97+
pull_request:
98+
paths:
99+
- '.github/workflows/android-build.yml'
100+
- 'example/android/**'
101+
- '**/nitrogen/generated/shared/**'
102+
- '**/nitrogen/generated/android/**'
103+
- 'cpp/**'
104+
- 'android/**'
105+
- '**/yarn.lock'
106+
- '**/react-native.config.js'
107+
- '**/nitro.json'
108+
workflow_dispatch:
109+
110+
concurrency:
111+
group: ${{ github.workflow }}-${{ github.ref }}
112+
cancel-in-progress: true
113+
37114
jobs:
38115
build:
39116
name: Build Android Example App (${{ matrix.arch }})
@@ -58,10 +135,6 @@ jobs:
58135
- name: Generate Nitro modules (codegen)
59136
run: yarn codegen
60137

61-
- name: Disable new architecture in gradle.properties
62-
if: matrix.arch == 'old'
63-
run: sed -i "s/newArchEnabled=true/newArchEnabled=false/g" example/android/gradle.properties
64-
65138
- name: Setup JDK 17
66139
uses: actions/setup-java@v5
67140
with:

.github/workflows/ios-build.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,8 @@ concurrency:
4747

4848
jobs:
4949
build:
50-
name: Build iOS Example App (${{ matrix.arch }})
50+
name: Build iOS Example App (New Architecture)
5151
runs-on: macOS-15
52-
strategy:
53-
fail-fast: false
54-
matrix:
55-
arch: [new, old]
5652
steps:
5753
- uses: actions/checkout@v4
5854
- uses: actions/setup-node@v4
@@ -70,10 +66,6 @@ jobs:
7066
- name: Generate Nitro modules (codegen)
7167
run: yarn codegen
7268

73-
- name: Disable new architecture in Podfile
74-
if: matrix.arch == 'old'
75-
run: sed -i "" "s/ENV\['RCT_NEW_ARCH_ENABLED'\] = '1'/ENV['RCT_NEW_ARCH_ENABLED'] = '0'/g" example/ios/Podfile
76-
7769
- name: Setup Ruby (bundle)
7870
uses: ruby/setup-ruby@v1
7971
with:

0 commit comments

Comments
 (0)