version 1 complete #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
| # .github/workflows/ci.yml | |
| name: CI | |
| on: [push, pull_request] | |
| jobs: | |
| ios-build: | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Select Xcode 16.x | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: "16.x" | |
| # Pick the first available iPhone simulator dynamically (no hardcoding). | |
| - name: Pick iPhone simulator | |
| id: pick-sim | |
| shell: bash | |
| run: | | |
| NAME="$(xcrun simctl list devices available | sed -nE 's/.*(iPhone [^()]+) \(.*/\1/p' | head -n 1)" | |
| if [[ -z "$NAME" ]]; then | |
| echo "No iPhone simulator found" >&2 | |
| exit 1 | |
| fi | |
| echo "name=$NAME" >> "$GITHUB_OUTPUT" | |
| echo "Using simulator: $NAME" | |
| - name: Build iOS app (no tests, no signing) | |
| run: | | |
| set -o pipefail | |
| xcodebuild \ | |
| -project SleepTrigger.xcodeproj \ | |
| -scheme "SleepTrigger" \ | |
| -sdk iphonesimulator \ | |
| -destination "platform=iOS Simulator,name=${{ steps.pick-sim.outputs.name }}" \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| clean build | |
| macos-build: | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Select Xcode 16.x | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: "16.x" | |
| - name: Build macOS app (no tests, no signing) | |
| run: | | |
| set -o pipefail | |
| xcodebuild \ | |
| -project SleepTrigger.xcodeproj \ | |
| -scheme "SleepTriggerMac" \ | |
| -destination "platform=macOS" \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| clean build | |
| watchos-build: | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Select Xcode 16.x | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: "16.x" | |
| - name: Build watchOS app (no tests, no signing) | |
| run: | | |
| set -o pipefail | |
| xcodebuild \ | |
| -project SleepTrigger.xcodeproj \ | |
| -scheme "SleepTriggerWatchOS Watch App" \ | |
| -destination "generic/platform=watchOS Simulator" \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| clean build |