ci: build apk and app on each commit #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 | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - '.github/workflows/build-ios.yml' | |
| - 'mobile-app/ios/**' | |
| - 'mobile-app/package.json' | |
| - 'mobile-app/yarn.lock' | |
| - 'mobile-app/package-lock.json' | |
| - 'mobile-app/src/**' | |
| - 'mobile-app/*.js' | |
| - 'mobile-app/*.ts' | |
| - 'mobile-app/*.tsx' | |
| - 'mobile-app/*.json' | |
| pull_request: | |
| branches: [master] | |
| paths: | |
| - '.github/workflows/build-ios.yml' | |
| - 'mobile-app/ios/**' | |
| - 'mobile-app/package.json' | |
| - 'mobile-app/yarn.lock' | |
| - 'mobile-app/package-lock.json' | |
| - 'mobile-app/src/**' | |
| - 'mobile-app/*.js' | |
| - 'mobile-app/*.ts' | |
| - 'mobile-app/*.tsx' | |
| - 'mobile-app/*.json' | |
| workflow_dispatch: | |
| jobs: | |
| build-ios: | |
| name: Build iOS IPA | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: mobile-app/package-lock.json | |
| - name: Install dependencies | |
| working-directory: mobile-app | |
| run: npm ci | |
| - name: Setup Nim | |
| run: | | |
| curl -sSf https://raw.githubusercontent.com/nim-lang/choosenim/master/init.sh | sh -s -- -y | |
| echo "$HOME/.nimble/bin" >> $GITHUB_PATH | |
| - name: Install Nim dependencies | |
| working-directory: mobile-app/nim | |
| run: | | |
| if [ -f "nimbridge.nimble" ]; then | |
| nimble install -d | |
| fi | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.0' | |
| bundler-cache: true | |
| working-directory: mobile-app/ios | |
| - name: Cache CocoaPods | |
| uses: actions/cache@v4 | |
| with: | |
| path: mobile-app/ios/Pods | |
| key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods- | |
| - name: Install CocoaPods dependencies | |
| working-directory: mobile-app/ios | |
| run: | | |
| pod install --repo-update || pod install | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode.app | |
| - name: Install xcbeautify | |
| run: brew install xcbeautify | |
| - name: Build iOS Simulator App | |
| working-directory: mobile-app/ios | |
| run: | | |
| set -o pipefail | |
| xcodebuild -workspace nimrnmobileapp.xcworkspace \ | |
| -scheme nimrnmobileapp \ | |
| -sdk iphonesimulator \ | |
| -configuration Debug \ | |
| -destination 'platform=iOS Simulator,name=iPhone 15' \ | |
| -derivedDataPath build \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| | xcbeautify | |
| - name: Build iOS Device App (unsigned) | |
| working-directory: mobile-app/ios | |
| run: | | |
| set -o pipefail | |
| xcodebuild -workspace nimrnmobileapp.xcworkspace \ | |
| -scheme nimrnmobileapp \ | |
| -sdk iphoneos \ | |
| -configuration Release \ | |
| -derivedDataPath build \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| | xcbeautify | |
| - name: Create IPA (unsigned) | |
| working-directory: mobile-app/ios | |
| run: | | |
| mkdir -p build/Payload | |
| cp -r build/Build/Products/Release-iphoneos/nimrnmobileapp.app build/Payload/ | |
| cd build | |
| zip -r nimrnmobileapp-unsigned.ipa Payload | |
| cd .. | |
| - name: Upload Simulator Build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios-simulator-app | |
| path: mobile-app/ios/build/Build/Products/Debug-iphonesimulator/nimrnmobileapp.app | |
| retention-days: 7 | |
| - name: Upload IPA (unsigned) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios-unsigned-ipa | |
| path: mobile-app/ios/build/nimrnmobileapp-unsigned.ipa | |
| retention-days: 7 |