|
| 1 | +name: Build iOS |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - '.github/workflows/build-ios.yml' |
| 9 | + - 'example/ios/**' |
| 10 | + - '**/nitrogen/generated/shared/**' |
| 11 | + - '**/nitrogen/generated/ios/**' |
| 12 | + - 'package/cpp/**' |
| 13 | + - 'package/ios/**' |
| 14 | + - '**/Podfile.lock' |
| 15 | + - '**/*.podspec' |
| 16 | + - '**/react-native.config.js' |
| 17 | + - '**/nitro.json' |
| 18 | + pull_request: |
| 19 | + paths: |
| 20 | + - '.github/workflows/build-ios.yml' |
| 21 | + - 'example/ios/**' |
| 22 | + - '**/nitrogen/generated/shared/**' |
| 23 | + - '**/nitrogen/generated/ios/**' |
| 24 | + - 'package/cpp/**' |
| 25 | + - 'package/ios/**' |
| 26 | + - '**/Podfile.lock' |
| 27 | + - '**/*.podspec' |
| 28 | + - '**/react-native.config.js' |
| 29 | + - '**/nitro.json' |
| 30 | + |
| 31 | +env: |
| 32 | + USE_CCACHE: 1 |
| 33 | + |
| 34 | +jobs: |
| 35 | + build_new: |
| 36 | + name: Build iOS Example App (new architecture) |
| 37 | + runs-on: macOS-15 |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + - uses: oven-sh/setup-bun@v2 |
| 41 | + |
| 42 | + - name: Install npm dependencies (bun) |
| 43 | + run: bun install |
| 44 | + |
| 45 | + - name: Restore ccache |
| 46 | + uses: hendrikmuhs/[email protected] |
| 47 | + |
| 48 | + - name: Setup Ruby (bundle) |
| 49 | + uses: ruby/setup-ruby@v1 |
| 50 | + with: |
| 51 | + ruby-version: 2.7.2 |
| 52 | + bundler-cache: true |
| 53 | + working-directory: example/ios |
| 54 | + |
| 55 | + - name: Restore Pods cache |
| 56 | + uses: actions/cache@v4 |
| 57 | + with: |
| 58 | + path: example/ios/Pods |
| 59 | + key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }} |
| 60 | + restore-keys: | |
| 61 | + ${{ runner.os }}-pods- |
| 62 | + - name: Install Pods |
| 63 | + working-directory: example/ios |
| 64 | + run: pod install |
| 65 | + - name: Build App |
| 66 | + working-directory: example/ios |
| 67 | + run: "set -o pipefail && xcodebuild \ |
| 68 | + CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ |
| 69 | + -derivedDataPath build -UseModernBuildSystem=YES \ |
| 70 | + -workspace NitroExample.xcworkspace \ |
| 71 | + -scheme NitroExample \ |
| 72 | + -sdk iphonesimulator \ |
| 73 | + -configuration Debug \ |
| 74 | + -destination 'platform=iOS Simulator,name=iPhone 16' \ |
| 75 | + build \ |
| 76 | + CODE_SIGNING_ALLOWED=NO" |
| 77 | + |
| 78 | + build_old: |
| 79 | + name: Build iOS Example App (old architecture) |
| 80 | + runs-on: macOS-15 |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v4 |
| 83 | + - uses: oven-sh/setup-bun@v2 |
| 84 | + |
| 85 | + - name: Install npm dependencies (bun) |
| 86 | + run: bun install |
| 87 | + |
| 88 | + - name: Disable new architecture in Podfile |
| 89 | + run: sed -i "" "s/ENV\['RCT_NEW_ARCH_ENABLED'\] = '1'/ENV['RCT_NEW_ARCH_ENABLED'] = '0'/g" example/ios/Podfile |
| 90 | + |
| 91 | + - name: Restore buildcache |
| 92 | + uses: mikehardy/buildcache-action@v2 |
| 93 | + continue-on-error: true |
| 94 | + |
| 95 | + - name: Setup Ruby (bundle) |
| 96 | + uses: ruby/setup-ruby@v1 |
| 97 | + with: |
| 98 | + ruby-version: 2.7.2 |
| 99 | + bundler-cache: true |
| 100 | + working-directory: example/ios |
| 101 | + |
| 102 | + - name: Restore Pods cache |
| 103 | + uses: actions/cache@v4 |
| 104 | + with: |
| 105 | + path: example/ios/Pods |
| 106 | + key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }} |
| 107 | + restore-keys: | |
| 108 | + ${{ runner.os }}-pods- |
| 109 | + - name: Install Pods |
| 110 | + working-directory: example/ios |
| 111 | + run: pod install |
| 112 | + - name: Build App |
| 113 | + working-directory: example/ios |
| 114 | + run: "set -o pipefail && xcodebuild \ |
| 115 | + CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ |
| 116 | + -derivedDataPath build -UseModernBuildSystem=YES \ |
| 117 | + -workspace NitroExample.xcworkspace \ |
| 118 | + -scheme NitroExample \ |
| 119 | + -sdk iphonesimulator \ |
| 120 | + -configuration Debug \ |
| 121 | + -destination 'platform=iOS Simulator,name=iPhone 16' \ |
| 122 | + build \ |
| 123 | + CODE_SIGNING_ALLOWED=NO" |
0 commit comments