[REFACTOR] 문서 정리: 중복 파일 통합 및 불필요한 파일 삭제 #16
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: | | |
| # Certificate와 비밀번호가 모두 제공된 경우에만 설정 시도 | |
| if [ -n "$APPLE_CERTIFICATE_BASE64" ] && [ -n "$APPLE_CERTIFICATE_PASSWORD" ]; then | |
| # Create keychain | |
| security create-keychain -p "" build.keychain || true | |
| security default-keychain -s build.keychain || true | |
| security unlock-keychain -p "" build.keychain || true | |
| security set-keychain-settings -t 3600 -u build.keychain || true | |
| # Import certificate | |
| echo "$APPLE_CERTIFICATE_BASE64" | base64 -d > certificate.p12 | |
| if ! security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign; then | |
| echo "Certificate import failed. Will continue with provisioning profile setup." | |
| fi | |
| # Import provisioning profile (if provided) | |
| if [ -n "$APPLE_PROVISIONING_PROFILE_BASE64" ]; then | |
| echo "$APPLE_PROVISIONING_PROFILE_BASE64" | base64 -d > profile.mobileprovision | |
| # Extract UUID from provisioning profile | |
| PROFILE_UUID=$(/usr/libexec/PlistBuddy -c "Print UUID" /dev/stdin <<< $(security cms -D -i profile.mobileprovision)) | |
| if [ -n "$PROFILE_UUID" ]; then | |
| mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
| cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/$PROFILE_UUID.mobileprovision | |
| echo "Provisioning profile installed as: $PROFILE_UUID.mobileprovision" | |
| else | |
| mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
| cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/ | |
| echo "Provisioning profile installed (UUID extraction failed)" | |
| fi | |
| fi | |
| # Set keychain to allow codesign | |
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "" build.keychain || true | |
| else | |
| echo "No certificate provided. Will use automatic signing." | |
| fi | |
| - 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 | |