|
| 1 | +name: Build iOS |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + paths: |
| 7 | + - '.github/workflows/build-ios.yml' |
| 8 | + - 'mobile-app/ios/**' |
| 9 | + - 'mobile-app/package.json' |
| 10 | + - 'mobile-app/yarn.lock' |
| 11 | + - 'mobile-app/package-lock.json' |
| 12 | + - 'mobile-app/src/**' |
| 13 | + - 'mobile-app/*.js' |
| 14 | + - 'mobile-app/*.ts' |
| 15 | + - 'mobile-app/*.tsx' |
| 16 | + - 'mobile-app/*.json' |
| 17 | + pull_request: |
| 18 | + branches: [master] |
| 19 | + paths: |
| 20 | + - '.github/workflows/build-ios.yml' |
| 21 | + - 'mobile-app/ios/**' |
| 22 | + - 'mobile-app/package.json' |
| 23 | + - 'mobile-app/yarn.lock' |
| 24 | + - 'mobile-app/package-lock.json' |
| 25 | + - 'mobile-app/src/**' |
| 26 | + - 'mobile-app/*.js' |
| 27 | + - 'mobile-app/*.ts' |
| 28 | + - 'mobile-app/*.tsx' |
| 29 | + - 'mobile-app/*.json' |
| 30 | + workflow_dispatch: |
| 31 | + |
| 32 | +jobs: |
| 33 | + build-ios: |
| 34 | + name: Build iOS IPA |
| 35 | + runs-on: macos-latest |
| 36 | + |
| 37 | + steps: |
| 38 | + - name: Checkout repository |
| 39 | + uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + submodules: recursive |
| 42 | + |
| 43 | + - name: Setup Node.js |
| 44 | + uses: actions/setup-node@v4 |
| 45 | + with: |
| 46 | + node-version: '20' |
| 47 | + cache: 'npm' |
| 48 | + cache-dependency-path: mobile-app/package-lock.json |
| 49 | + |
| 50 | + - name: Install dependencies |
| 51 | + working-directory: mobile-app |
| 52 | + run: npm ci |
| 53 | + |
| 54 | + - name: Setup Nim |
| 55 | + run: | |
| 56 | + # Install Nim from Homebrew on macOS |
| 57 | + brew install nim |
| 58 | + nim --version |
| 59 | + nimble --version |
| 60 | +
|
| 61 | + - name: Install Nim dependencies |
| 62 | + working-directory: mobile-app/nim |
| 63 | + run: | |
| 64 | + if [ -f "nimbridge.nimble" ]; then |
| 65 | + nimble install -d |
| 66 | + fi |
| 67 | +
|
| 68 | + - name: Setup Ruby |
| 69 | + uses: ruby/setup-ruby@v1 |
| 70 | + with: |
| 71 | + ruby-version: '3.0' |
| 72 | + bundler-cache: true |
| 73 | + working-directory: mobile-app/ios |
| 74 | + |
| 75 | + - name: Cache CocoaPods |
| 76 | + uses: actions/cache@v4 |
| 77 | + with: |
| 78 | + path: mobile-app/ios/Pods |
| 79 | + key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} |
| 80 | + restore-keys: | |
| 81 | + ${{ runner.os }}-pods- |
| 82 | +
|
| 83 | + - name: Install CocoaPods dependencies |
| 84 | + working-directory: mobile-app/ios |
| 85 | + run: | |
| 86 | + pod install --repo-update || pod install |
| 87 | +
|
| 88 | + - name: Select Xcode |
| 89 | + run: sudo xcode-select -s /Applications/Xcode.app |
| 90 | + |
| 91 | + - name: Install xcbeautify |
| 92 | + run: brew install xcbeautify |
| 93 | + |
| 94 | + - name: Build iOS Simulator App |
| 95 | + working-directory: mobile-app/ios |
| 96 | + run: | |
| 97 | + set -o pipefail |
| 98 | + xcodebuild -workspace nimrnmobileapp.xcworkspace \ |
| 99 | + -scheme nimrnmobileapp \ |
| 100 | + -sdk iphonesimulator \ |
| 101 | + -configuration Debug \ |
| 102 | + -destination 'platform=iOS Simulator,name=iPhone 15' \ |
| 103 | + -derivedDataPath build \ |
| 104 | + CODE_SIGNING_ALLOWED=NO \ |
| 105 | + | xcbeautify |
| 106 | +
|
| 107 | + - name: Build iOS Device App (unsigned) |
| 108 | + working-directory: mobile-app/ios |
| 109 | + run: | |
| 110 | + set -o pipefail |
| 111 | + xcodebuild -workspace nimrnmobileapp.xcworkspace \ |
| 112 | + -scheme nimrnmobileapp \ |
| 113 | + -sdk iphoneos \ |
| 114 | + -configuration Release \ |
| 115 | + -derivedDataPath build \ |
| 116 | + CODE_SIGNING_ALLOWED=NO \ |
| 117 | + CODE_SIGN_IDENTITY="" \ |
| 118 | + CODE_SIGNING_REQUIRED=NO \ |
| 119 | + | xcbeautify |
| 120 | +
|
| 121 | + - name: Create IPA (unsigned) |
| 122 | + working-directory: mobile-app/ios |
| 123 | + run: | |
| 124 | + mkdir -p build/Payload |
| 125 | + cp -r build/Build/Products/Release-iphoneos/nimrnmobileapp.app build/Payload/ |
| 126 | + cd build |
| 127 | + zip -r nimrnmobileapp-unsigned.ipa Payload |
| 128 | + cd .. |
| 129 | +
|
| 130 | + - name: Upload Simulator Build |
| 131 | + uses: actions/upload-artifact@v4 |
| 132 | + with: |
| 133 | + name: ios-simulator-app |
| 134 | + path: mobile-app/ios/build/Build/Products/Debug-iphonesimulator/nimrnmobileapp.app |
| 135 | + retention-days: 7 |
| 136 | + |
| 137 | + - name: Upload IPA (unsigned) |
| 138 | + uses: actions/upload-artifact@v4 |
| 139 | + with: |
| 140 | + name: ios-unsigned-ipa |
| 141 | + path: mobile-app/ios/build/nimrnmobileapp-unsigned.ipa |
| 142 | + retention-days: 7 |
0 commit comments