Build iOS #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build iOS | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: build-ios-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref_name != 'main' }} | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/build-ios.yml' | |
| - 'example/ios/**' | |
| - 'example/package.json' | |
| - 'packages/*/cpp/**' | |
| - 'packages/*/ios/**' | |
| - 'packages/*/nitrogen/generated/shared/**' | |
| - 'packages/*/nitrogen/generated/ios/**' | |
| - 'packages/*/package.json' | |
| - 'bun.lock' | |
| - '**/Podfile.lock' | |
| - '**/*.podspec' | |
| - '**/react-native.config.js' | |
| - '**/nitro.json' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/build-ios.yml' | |
| - 'example/ios/**' | |
| - 'example/package.json' | |
| - 'packages/*/cpp/**' | |
| - 'packages/*/ios/**' | |
| - 'packages/*/nitrogen/generated/shared/**' | |
| - 'packages/*/nitrogen/generated/ios/**' | |
| - 'packages/*/package.json' | |
| - 'bun.lock' | |
| - '**/Podfile.lock' | |
| - '**/*.podspec' | |
| - '**/react-native.config.js' | |
| - '**/nitro.json' | |
| env: | |
| USE_CCACHE: 1 | |
| XCODE_VERSION: '26.5' | |
| IOS_SIMULATOR_DESTINATION: 'platform=iOS Simulator,arch=arm64,name=iPhone 17 Pro' | |
| jobs: | |
| build: | |
| name: Build iOS Example App | |
| runs-on: macOS-26 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install npm dependencies (bun) | |
| run: bun install | |
| - name: Install Ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| max-size: 1.5G | |
| key: ${{ runner.os }}-${{ runner.arch }}-xcode${{ env.XCODE_VERSION }}-ccache-example-ios | |
| create-symlink: true | |
| - name: Setup ccache behavior | |
| run: | | |
| echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros" >> $GITHUB_ENV | |
| echo "CCACHE_FILECLONE=true" >> $GITHUB_ENV | |
| echo "CCACHE_DEPEND=true" >> $GITHUB_ENV | |
| echo "CCACHE_INODECACHE=true" >> $GITHUB_ENV | |
| - name: Setup Ruby (bundle) | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| working-directory: example | |
| - name: Select Xcode ${{ env.XCODE_VERSION }} | |
| run: sudo xcode-select -s "/Applications/Xcode_${{ env.XCODE_VERSION }}.app/Contents/Developer" | |
| - name: Restore Pods cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: example/ios/Pods | |
| key: ${{ runner.os }}-${{ runner.arch }}-pods-${{ hashFiles('bun.lock', 'example/Gemfile.lock', 'example/ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-pods- | |
| - name: Install Pods | |
| working-directory: example | |
| run: cd ios && bundle exec pod install | |
| - name: Restore DerivedData cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: example/ios/build | |
| key: ${{ runner.os }}-${{ runner.arch }}-xcode${{ env.XCODE_VERSION }}-dd-${{ hashFiles('bun.lock', 'example/Gemfile.lock', 'example/ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-xcode${{ env.XCODE_VERSION }}-dd- | |
| - name: Build App | |
| working-directory: example/ios | |
| run: | | |
| set -o pipefail | |
| xcodebuild \ | |
| CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ | |
| -derivedDataPath build -UseModernBuildSystem=YES \ | |
| -workspace NativeComposeChat.xcworkspace \ | |
| -scheme NativeComposeChat \ | |
| -sdk iphonesimulator \ | |
| -configuration Debug \ | |
| -destination '${{ env.IOS_SIMULATOR_DESTINATION }}' \ | |
| -showBuildTimingSummary \ | |
| ONLY_ACTIVE_ARCH=YES \ | |
| build \ | |
| CODE_SIGNING_ALLOWED=NO | xcbeautify --renderer github-actions |