CI #3
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: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Build and test (simulator) | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.4.app 2>/dev/null || sudo xcode-select -s /Applications/Xcode_16.2.app 2>/dev/null || sudo xcode-select -s /Applications/Xcode.app | |
| - name: Boot simulator | |
| run: | | |
| xcrun simctl shutdown all 2>/dev/null || true | |
| xcrun simctl boot "iPhone 17" 2>/dev/null || true | |
| xcrun simctl list devices | grep "iPhone 17 (" | head -1 | |
| - name: Build for simulator (unsigned) | |
| run: | | |
| xcodebuild build \ | |
| -project Juchebox.xcodeproj \ | |
| -scheme Juchebox \ | |
| -destination 'platform=iOS Simulator,name=iPhone 17' \ | |
| -derivedDataPath build/DerivedData \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGN_ENTITLEMENTS="" | |
| - name: Run unit tests | |
| run: | | |
| xcodebuild test \ | |
| -project Juchebox.xcodeproj \ | |
| -scheme Juchebox \ | |
| -destination 'platform=iOS Simulator,name=iPhone 17' \ | |
| -derivedDataPath build/DerivedData \ | |
| -only-testing:JucheboxTests \ | |
| CODE_SIGNING_ALLOWED=NO | |
| ipa: | |
| name: Build unsigned .ipa | |
| runs-on: macos-15 | |
| needs: test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.4.app 2>/dev/null || sudo xcode-select -s /Applications/Xcode_16.2.app 2>/dev/null || sudo xcode-select -s /Applications/Xcode.app | |
| - name: Archive (unsigned, device SDK) | |
| run: | | |
| xcodebuild archive \ | |
| -project Juchebox.xcodeproj \ | |
| -scheme Juchebox \ | |
| -configuration Release \ | |
| -destination 'generic/platform=iOS' \ | |
| -archivePath build/Juchebox.xcarchive \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGN_ENTITLEMENTS="" | |
| - name: Package unsigned .ipa (Payload zip) | |
| run: | | |
| APP_PATH=$(find build/Juchebox.xcarchive -name '*.app' -type d | head -1) | |
| mkdir -p build/Payload | |
| cp -R "$APP_PATH" build/Payload/ | |
| cd build | |
| zip -r Juchebox-unsigned.ipa Payload -x "._*" -x ".DS_Store" -x "__MACOSX" | |
| ls -lh Juchebox-unsigned.ipa | |
| - name: Upload .ipa artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Juchebox-unsigned-${{ github.sha }} | |
| path: build/Juchebox-unsigned.ipa | |
| retention-days: 14 | |
| - name: Upload xcarchive (for re-signing with your own team) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Juchebox-xcarchive-${{ github.sha }} | |
| path: build/Juchebox.xcarchive | |
| retention-days: 14 |