[CD] 초기 오류 수정 #13
Workflow file for this run
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
| # This workflow will build a Swift project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift | |
| name: iOS CD (Stage -> TestFlight) | |
| on: | |
| # develop이 아닌 env/stage 브랜치에 코드가 push 되거나 PR이 병합될 때 트리거됩니다. | |
| pull_request: | |
| branches: ["env/dev", "env/stage"] | |
| jobs: | |
| deploy-testflight: | |
| runs-on: macos-15 | |
| # 🔥 이전에 GitHub 설정에서 만든 승인 대기 환경 (이름이 다르면 맞춰주세요) | |
| # 이 줄 덕분에 워크플로우가 바로 실행되지 않고 수락을 기다립니다. | |
| environment: TestFlight-Deploy | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: "16.2" | |
| - name: Install iOS SDK (Retry up to 3 times) | |
| run: | | |
| for i in {1..3}; do | |
| echo "Attempt $i to download iOS platform..." | |
| sudo xcodebuild -downloadPlatform iOS && break || { | |
| if [ $i -lt 3 ]; then | |
| echo "Attempt $i failed. Retrying in 10 seconds..." | |
| sleep 10 | |
| else | |
| echo "All 3 attempts failed. Moving on (continue-on-error is set)." | |
| exit 1 | |
| fi | |
| } | |
| done | |
| - name: Create Real Configs | |
| run: | | |
| # 1. 절대 경로로 확실하게 폴더 생성 | |
| mkdir -p Atcha-iOS/Atcha-iOS | |
| # 2. Xcode가 에러 로그에서 찾고 있는 그 경로에 직접 파일 생성 | |
| # 에러 로그: /Users/runner/work/Atcha-iOS/Atcha-iOS/Atcha-iOS/StageConfig.xcconfig | |
| echo "${{ secrets.STAGE_CONFIG_CONTENT }}" > "Atcha-iOS/Atcha-iOS/StageConfig.xcconfig" | |
| echo "${{ secrets.BASE_CONFIG_CONTENT }}" > "Atcha-iOS/Atcha-iOS/BaseConfig.xcconfig" | |
| # 3. 만약 프로젝트 파일(.xcodeproj)이 루트에 있다면 루트에도 복사 (보험용) | |
| cp "Atcha-iOS/Atcha-iOS/StageConfig.xcconfig" "./StageConfig.xcconfig" || true | |
| cp "Atcha-iOS/Atcha-iOS/BaseConfig.xcconfig" "./BaseConfig.xcconfig" || true | |
| echo "Config files created successfully." | |
| ls -R Atcha-iOS/Atcha-iOS # 파일이 잘 들어갔는지 로그에 출력 | |
| - name: Install Fastlane | |
| run: bundle install | |
| - name: Build and Upload to TestFlight | |
| env: | |
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
| MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_TOKEN }} | |
| APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }} | |
| APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.ASC_KEY_ID }} | |
| APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.ASC_KEY_CONTENT }} | |
| GYM_SCHEME: "Atcha-Stage" | |
| GYM_CONFIGURATION: "Release" | |
| GYM_EXPORT_METHOD: "app-store" | |
| GYM_XC_ARGS: "PROVISIONING_PROFILE_SPECIFIER='match AppStore com.atcha.iOS' CODE_SIGN_STYLE=Manual" | |
| FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 120 | |
| # Fastfile에 작성된 테플 업로드용 lane 실행 (이름은 설정하신 대로 맞춰주세요) | |
| run: bundle exec fastlane beta |