|
| 1 | +name: Build iOS |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + paths: |
| 11 | + - '.github/workflows/ios-build.yml' |
| 12 | + - 'example/ios/**' |
| 13 | + - 'example/Gemfile' |
| 14 | + - 'example/Gemfile.lock' |
| 15 | + - '**/nitrogen/generated/shared/**' |
| 16 | + - '**/nitrogen/generated/ios/**' |
| 17 | + - 'cpp/**' |
| 18 | + - 'ios/**' |
| 19 | + - '**/Podfile.lock' |
| 20 | + - '**/bun.lock' |
| 21 | + - '**/*.podspec' |
| 22 | + - '**/react-native.config.js' |
| 23 | + - '**/nitro.json' |
| 24 | + pull_request: |
| 25 | + paths: |
| 26 | + - '.github/workflows/ios-build.yml' |
| 27 | + - 'example/ios/**' |
| 28 | + - 'example/Gemfile' |
| 29 | + - 'example/Gemfile.lock' |
| 30 | + - '**/nitrogen/generated/shared/**' |
| 31 | + - '**/nitrogen/generated/ios/**' |
| 32 | + - 'cpp/**' |
| 33 | + - 'ios/**' |
| 34 | + - '**/Podfile.lock' |
| 35 | + - '**/bun.lock' |
| 36 | + - '**/*.podspec' |
| 37 | + - '**/react-native.config.js' |
| 38 | + - '**/nitro.json' |
| 39 | + workflow_dispatch: |
| 40 | + |
| 41 | +env: |
| 42 | + USE_CCACHE: 1 |
| 43 | + |
| 44 | +concurrency: |
| 45 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 46 | + cancel-in-progress: true |
| 47 | + |
| 48 | +jobs: |
| 49 | + build: |
| 50 | + name: Build iOS Example App (${{ matrix.arch }}) |
| 51 | + runs-on: macOS-15 |
| 52 | + strategy: |
| 53 | + fail-fast: false |
| 54 | + matrix: |
| 55 | + arch: [new, old] |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + - uses: oven-sh/setup-bun@v2 |
| 59 | + - name: Setup Xcode |
| 60 | + uses: maxim-lobanov/setup-xcode@v1 |
| 61 | + with: |
| 62 | + xcode-version: 16.4 |
| 63 | + |
| 64 | + - name: Install dependencies (bun) |
| 65 | + run: bun install |
| 66 | + |
| 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 | + |
| 71 | + - name: Setup Ruby (bundle) |
| 72 | + uses: ruby/setup-ruby@v1 |
| 73 | + with: |
| 74 | + ruby-version: '3.2' |
| 75 | + bundler-cache: true |
| 76 | + working-directory: example/ios |
| 77 | + |
| 78 | + - name: Install xcpretty |
| 79 | + run: gem install xcpretty |
| 80 | + |
| 81 | + - name: Cache CocoaPods |
| 82 | + uses: actions/cache@v4 |
| 83 | + with: |
| 84 | + path: | |
| 85 | + ~/.cocoapods/repos |
| 86 | + example/ios/Pods |
| 87 | + key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }} |
| 88 | + restore-keys: | |
| 89 | + ${{ runner.os }}-pods- |
| 90 | +
|
| 91 | + - name: Install Pods |
| 92 | + working-directory: example/ios |
| 93 | + run: pod install |
| 94 | + |
| 95 | + - name: Build App |
| 96 | + working-directory: example/ios |
| 97 | + run: | |
| 98 | + set -o pipefail && xcodebuild \ |
| 99 | + CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ |
| 100 | + -derivedDataPath build -UseModernBuildSystem=YES \ |
| 101 | + -workspace NitroTextExample.xcworkspace \ |
| 102 | + -scheme NitroTextExample \ |
| 103 | + -sdk iphonesimulator \ |
| 104 | + -configuration Debug \ |
| 105 | + -destination 'platform=iOS Simulator,name=iPhone 16' \ |
| 106 | + build \ |
| 107 | + CODE_SIGNING_ALLOWED=NO | xcpretty |
0 commit comments