[FIX] develop 브랜치 iOS 빌드에 provisioning profile 설정 추가 #12
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: Develop Build & Deploy | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| workflow_dispatch: | |
| jobs: | |
| build-android-dev: | |
| name: Build Android Dev | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.24.5' | |
| channel: 'stable' | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Build Android APK (Dev) | |
| run: | | |
| flutter build apk --release \ | |
| --build-name=1.0.0-dev \ | |
| --build-number=${{ github.run_number }} \ | |
| --dart-define=API_ENV=dev | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-dev-apk | |
| path: build/app/outputs/flutter-apk/app-release.apk | |
| retention-days: 30 | |
| build-ios-dev: | |
| name: Build iOS Dev | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.24.5' | |
| channel: 'stable' | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Install CocoaPods dependencies | |
| run: | | |
| cd ios | |
| pod install | |
| - name: Setup iOS Certificates and Profiles | |
| env: | |
| APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| APPLE_PROVISIONING_PROFILE_BASE64: ${{ secrets.APPLE_PROVISIONING_PROFILE_BASE64 }} | |
| run: | | |
| # Create keychain | |
| 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 | |
| # Import certificate | |
| echo "$APPLE_CERTIFICATE_BASE64" | base64 -d > certificate.p12 | |
| security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign | |
| # Import provisioning profile | |
| echo "$APPLE_PROVISIONING_PROFILE_BASE64" | base64 -d > profile.mobileprovision | |
| mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
| cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/ | |
| # Set keychain to allow codesign | |
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "" build.keychain | |
| - name: Build iOS IPA (Dev) | |
| run: | | |
| flutter build ipa --release \ | |
| --build-name=1.0.0-dev \ | |
| --build-number=${{ github.run_number }} \ | |
| --dart-define=API_ENV=dev \ | |
| --export-options-plist=ios/ExportOptions-dev.plist | |
| - name: Upload IPA artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios-dev-ipa | |
| path: build/ios/ipa/*.ipa | |
| retention-days: 30 | |
| - name: Upload to TestFlight (Dev) | |
| if: success() | |
| env: | |
| APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} | |
| APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} | |
| APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }} | |
| run: | | |
| # Create API key file | |
| mkdir -p ~/private_keys | |
| echo "$APP_STORE_CONNECT_API_KEY" > ~/private_keys/AuthKey_$APP_STORE_CONNECT_API_KEY_ID.p8 | |
| chmod 600 ~/private_keys/AuthKey_$APP_STORE_CONNECT_API_KEY_ID.p8 | |
| # Upload using xcrun altool | |
| xcrun altool --upload-app \ | |
| --type ios \ | |
| --file build/ios/ipa/*.ipa \ | |
| --apiKey $APP_STORE_CONNECT_API_KEY_ID \ | |
| --apiIssuer $APP_STORE_CONNECT_ISSUER_ID \ | |
| --verbose | |