Skip to content

Commit 9403fb5

Browse files
committed
chore: refactor iOS build workflow to use matrix strategy and update Ruby version
1 parent fb17db5 commit 9403fb5

1 file changed

Lines changed: 29 additions & 72 deletions

File tree

.github/workflows/ios-build.yml

Lines changed: 29 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Build iOS
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches:
@@ -33,116 +36,70 @@ on:
3336
- '**/*.podspec'
3437
- '**/react-native.config.js'
3538
- '**/nitro.json'
39+
workflow_dispatch:
3640

3741
env:
3842
USE_CCACHE: 1
3943

40-
4144
concurrency:
4245
group: ${{ github.workflow }}-${{ github.ref }}
4346
cancel-in-progress: true
4447

4548
jobs:
46-
build_new:
47-
name: Build iOS Example App (new architecture)
49+
build:
50+
name: Build iOS Example App (${{ matrix.arch }})
4851
runs-on: macOS-15
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
arch: [new, old]
4956
steps:
5057
- uses: actions/checkout@v6
5158
- uses: oven-sh/setup-bun@v2
52-
5359
- name: Setup Xcode
5460
uses: maxim-lobanov/setup-xcode@v1
5561
with:
5662
xcode-version: 16.4
5763

58-
- name: Install npm dependencies (bun)
64+
- name: Install dependencies (bun)
5965
run: bun install
6066

67+
- name: Disable new architecture in Podfile
68+
if: matrix.arch == 'old'
69+
run: sed -i "" "s/ENV\['RCT_NEW_ARCH_ENABLED'\] = '1'/ENV['RCT_NEW_ARCH_ENABLED'] = '0'/g" example/ios/Podfile
70+
6171
- name: Setup Ruby (bundle)
6272
uses: ruby/setup-ruby@v1
6373
with:
64-
ruby-version: 2.7.2
74+
ruby-version: '3.2'
6575
bundler-cache: true
6676
working-directory: example/ios
6777

6878
- name: Install xcpretty
6979
run: gem install xcpretty
7080

71-
# - name: Restore Pods cache
81+
# - name: Cache CocoaPods
7282
# uses: actions/cache@v4
7383
# with:
7484
# path: example/ios/Pods
75-
# key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }}
85+
# key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile') }}
7686
# restore-keys: |
7787
# ${{ runner.os }}-pods-
7888

7989
- name: Install Pods
8090
working-directory: example/ios
8191
run: pod install
82-
- name: Build App
83-
working-directory: example/ios
84-
run: "set -o pipefail && xcodebuild \
85-
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
86-
-derivedDataPath build -UseModernBuildSystem=YES \
87-
-workspace NitroFsExample.xcworkspace \
88-
-scheme NitroFsExample \
89-
-sdk iphonesimulator \
90-
-configuration Debug \
91-
-destination 'platform=iOS Simulator,name=iPhone 16' \
92-
build \
93-
CODE_SIGNING_ALLOWED=NO | xcpretty"
94-
95-
build_old:
96-
name: Build iOS Example App (old architecture)
97-
runs-on: macOS-15
98-
steps:
99-
- uses: actions/checkout@v6
100-
- uses: oven-sh/setup-bun@v2
101-
102-
- name: Setup Xcode
103-
uses: maxim-lobanov/setup-xcode@v1
104-
with:
105-
xcode-version: 16.4
106-
107-
- name: Install npm dependencies (bun)
108-
run: bun install
109-
110-
- name: Disable new architecture in Podfile
111-
run: sed -i "" "s/ENV\['RCT_NEW_ARCH_ENABLED'\] = '1'/ENV['RCT_NEW_ARCH_ENABLED'] = '0'/g" example/ios/Podfile
112-
113-
- name: Restore buildcache
114-
uses: mikehardy/buildcache-action@v2
115-
continue-on-error: true
116-
117-
- name: Setup Ruby (bundle)
118-
uses: ruby/setup-ruby@v1
119-
with:
120-
ruby-version: 2.7.2
121-
bundler-cache: true
122-
working-directory: example/ios
123-
124-
- name: Install xcpretty
125-
run: gem install xcpretty
12692

127-
- name: Restore Pods cache
128-
uses: actions/cache@v4
129-
with:
130-
path: example/ios/Pods
131-
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }}
132-
restore-keys: |
133-
${{ runner.os }}-pods-
134-
- name: Install Pods
135-
working-directory: example/ios
136-
run: pod install
13793
- name: Build App
13894
working-directory: example/ios
139-
run: "set -o pipefail && xcodebuild \
140-
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
141-
-derivedDataPath build -UseModernBuildSystem=YES \
142-
-workspace NitroFsExample.xcworkspace \
143-
-scheme NitroFsExample \
144-
-sdk iphonesimulator \
145-
-configuration Debug \
146-
-destination 'platform=iOS Simulator,name=iPhone 16' \
147-
build \
148-
CODE_SIGNING_ALLOWED=NO | xcpretty"
95+
run: |
96+
set -o pipefail && xcodebuild \
97+
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
98+
-derivedDataPath build -UseModernBuildSystem=YES \
99+
-workspace NitroTextExample.xcworkspace \
100+
-scheme NitroTextExample \
101+
-sdk iphonesimulator \
102+
-configuration Debug \
103+
-destination 'platform=iOS Simulator,name=iPhone 16' \
104+
build \
105+
CODE_SIGNING_ALLOWED=NO | xcpretty

0 commit comments

Comments
 (0)