copilot: add tests for /responses routing and needs_responses_api #7
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: iOS TestFlight | ||
| env: | ||
| JCODE_CI: "1" | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: [master] | ||
| paths: | ||
| - "ios/**" | ||
| - ".github/workflows/ios-testflight.yml" | ||
| concurrency: | ||
| group: ios-testflight-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| env: | ||
| BUNDLE_ID: com.jcode.mobile | ||
| SCHEME: JCodeMobile | ||
| TEAM_ID: TAS6ARKDN7 | ||
| jobs: | ||
| test: | ||
| name: swift test (JCodeKit) | ||
| runs-on: macos-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Swift toolchain info | ||
| run: | | ||
| sw_vers | ||
| xcodebuild -version | ||
| swift --version | ||
| - name: Run JCodeKit tests on macOS | ||
| working-directory: ios | ||
| run: swift test | ||
| compile-check: | ||
| name: xcodebuild (simulator, unsigned) | ||
| runs-on: macos-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install XcodeGen | ||
| run: brew install xcodegen | ||
| - name: Generate Xcode project | ||
| working-directory: ios | ||
| run: xcodegen generate | ||
| - name: Build app target for iOS simulator (no signing) | ||
| working-directory: ios | ||
| run: | | ||
| set -o pipefail | ||
| xcodebuild build \ | ||
| -project JCodeMobile.xcodeproj \ | ||
| -scheme "$SCHEME" \ | ||
| -configuration Debug \ | ||
| -destination "generic/platform=iOS Simulator" \ | ||
| CODE_SIGNING_ALLOWED=NO \ | ||
| | tail -60 | ||
| build-and-upload: | ||
| name: Build, sign, upload to TestFlight | ||
| needs: [test, compile-check] | ||
| runs-on: macos-latest | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install XcodeGen | ||
| run: brew install xcodegen | ||
| - name: Generate Xcode project | ||
| working-directory: ios | ||
| run: xcodegen generate | ||
| - name: Write App Store Connect API key | ||
| env: | ||
| APPSTORE_API_KEY_P8: ${{ secrets.APPSTORE_API_KEY_P8 }} | ||
| run: | | ||
| mkdir -p ~/private_keys | ||
| printf '%s' "$APPSTORE_API_KEY_P8" > ~/private_keys/AuthKey_${{ secrets.APPSTORE_API_KEY_ID }}.p8 | ||
| chmod 600 ~/private_keys/AuthKey_${{ secrets.APPSTORE_API_KEY_ID }}.p8 | ||
| - name: Archive (unsigned; signing happens at export) | ||
| working-directory: ios | ||
| run: | | ||
| set -o pipefail | ||
| # The team has no registered devices, so a development profile can | ||
| # never be created at archive time. Archive unsigned; the export | ||
| # step signs with cloud-managed Apple Distribution via the ASC key. | ||
| xcodebuild archive \ | ||
| -project JCodeMobile.xcodeproj \ | ||
| -scheme "$SCHEME" \ | ||
| -configuration Release \ | ||
| -destination "generic/platform=iOS" \ | ||
| -archivePath build/JCodeMobile.xcarchive \ | ||
| CODE_SIGNING_ALLOWED=NO \ | ||
| CODE_SIGN_IDENTITY="" \ | ||
| DEVELOPMENT_TEAM="$TEAM_ID" \ | ||
| CURRENT_PROJECT_VERSION="${{ github.run_number }}" \ | ||
| | tail -100 | ||
| - name: Write export options | ||
| working-directory: ios | ||
| run: | | ||
| cat > ExportOptions.plist <<'EOF' | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>method</key> | ||
| <string>app-store-connect</string> | ||
| <key>destination</key> | ||
| <string>upload</string> | ||
| <key>teamID</key> | ||
| <string>TAS6ARKDN7</string> | ||
| <key>signingStyle</key> | ||
| <string>automatic</string> | ||
| <key>uploadSymbols</key> | ||
| <true/> | ||
| <key>manageAppVersionAndBuildNumber</key> | ||
| <false/> | ||
| </dict> | ||
| </plist> | ||
| EOF | ||
| - name: Export and upload to App Store Connect | ||
| working-directory: ios | ||
| run: | | ||
| set -o pipefail | ||
| xcodebuild -exportArchive \ | ||
| -archivePath build/JCodeMobile.xcarchive \ | ||
| -exportOptionsPlist ExportOptions.plist \ | ||
| -exportPath build/export \ | ||
| -allowProvisioningUpdates \ | ||
| -authenticationKeyPath "$HOME/private_keys/AuthKey_${{ secrets.APPSTORE_API_KEY_ID }}.p8" \ | ||
| -authenticationKeyID "${{ secrets.APPSTORE_API_KEY_ID }}" \ | ||
| -authenticationKeyIssuerID "${{ secrets.APPSTORE_ISSUER_ID }}" \ | ||
| | tail -60 | ||
| - name: Cleanup API key | ||
| if: always() | ||
| run: rm -rf ~/private_keys | ||