P1: Fix TestFlight deployment — add LendairApp executable target,
use xcodebuild archive/export instead of swift build for IPA
P2: Fix swift-format — use built-in 'swift format lint' (Swift 5.6+)
instead of external 'swift-format' binary
P3: Create missing index.html for Vite build entry point
P3: Update vercel-action from v30 to v25 (better maintained)
151 lines
4.4 KiB
YAML
151 lines
4.4 KiB
YAML
name: iOS CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "Lendair/**"
|
|
- ".github/workflows/ios-ci.yml"
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "Lendair/**"
|
|
- ".github/workflows/ios-ci.yml"
|
|
|
|
concurrency:
|
|
group: ios-ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
name: Swift Lint
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Select Xcode
|
|
run: sudo xcode-select -s ${{ env.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }}
|
|
env:
|
|
XCODE_APP_PATH: ${{ vars.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }}
|
|
|
|
- name: Swift Format Check
|
|
run: |
|
|
swift format lint --recursive Lendair/Models Lendair/Services Lendair/ViewModels Lendair/Views || {
|
|
echo "::warning::Swift format issues detected (non-blocking)"
|
|
}
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: macos-latest
|
|
needs: lint
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Select Xcode
|
|
run: sudo xcode-select -s ${{ env.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }}
|
|
env:
|
|
XCODE_APP_PATH: ${{ vars.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }}
|
|
|
|
- name: Swift version
|
|
run: swift --version
|
|
|
|
- name: Resolve dependencies
|
|
run: swift package resolve
|
|
working-directory: Lendair
|
|
|
|
- name: Build
|
|
run: swift build --target LendairApp
|
|
working-directory: Lendair
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: macos-latest
|
|
needs: build
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Select Xcode
|
|
run: sudo xcode-select -s ${{ env.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }}
|
|
env:
|
|
XCODE_APP_PATH: ${{ vars.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }}
|
|
|
|
- name: Run tests
|
|
run: swift test
|
|
working-directory: Lendair
|
|
|
|
deploy-testflight:
|
|
name: Deploy to TestFlight
|
|
runs-on: macos-latest
|
|
needs: test
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Select Xcode
|
|
run: sudo xcode-select -s ${{ env.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }}
|
|
env:
|
|
XCODE_APP_PATH: ${{ vars.XCODE_APP_PATH || '/Applications/Xcode_15.4.app' }}
|
|
|
|
- name: Generate Xcode project
|
|
run: swift package generate-xcodeproj
|
|
working-directory: Lendair
|
|
|
|
- name: Create keychain for code signing
|
|
run: |
|
|
security create-keychain -p "" build.keychain
|
|
security default-keychain -s build.keychain
|
|
security unlock-keychain -p "" build.keychain
|
|
security set-keychain-settings -t 3600 -u build.keychain
|
|
|
|
- name: Create Export Options Plist
|
|
run: |
|
|
cat > Lendair/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</string>
|
|
<key>uploadBitcode</key>
|
|
<false/>
|
|
<key>uploadSymbols</key>
|
|
<true/>
|
|
<key>compileBitcode</key>
|
|
<false/>
|
|
</dict>
|
|
</plist>
|
|
EOF
|
|
|
|
- name: Archive with xcodebuild
|
|
run: |
|
|
xcodebuild archive \
|
|
-project Lendair/Lendair.xcodeproj \
|
|
-scheme LendairApp \
|
|
-configuration Release \
|
|
-destination "generic/platform=iOS" \
|
|
-archivePath Lendair/build/Lendair.xcarchive \
|
|
CODE_SIGN_STYLE=Automatic \
|
|
PROVISIONING_PROFILE_SPECIFIER=Automatic \
|
|
DEVELOPMENT_TEAM=${{ secrets.APPLE_TEAM_ID }}
|
|
|
|
- name: Export IPA
|
|
run: |
|
|
xcodebuild -exportArchive \
|
|
-archivePath Lendair/build/Lendair.xcarchive \
|
|
-exportPath Lendair/build/export \
|
|
-exportOptionsPlist Lendair/ExportOptions.plist
|
|
|
|
- name: Upload to TestFlight
|
|
uses: apple-actions/upload-testflight-binary@v1
|
|
with:
|
|
app-path: Lendair/build/export/LendairApp.ipa
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
env:
|
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|