[Setting] Share Extension 추가에 따른 Fastlane 세팅 수정 및 배포 테스트 #27
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 Release CI | |
| on: | |
| push: | |
| branches: | |
| - release | |
| concurrency: | |
| group: build-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # 1. Xcode 버전 명시적 설정 | |
| - name: Select Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '26.2' | |
| # 2. 깃허브 Secret에서 Release.xcconfig 파일 생성하기 | |
| - name: Create Release.xcconfig | |
| run: | | |
| mkdir -p Neki-iOS/APP/Sources/Resources | |
| echo "${{ secrets.RELEASE_XCCONFIG }}" | base64 --decode > Neki-iOS/APP/Sources/Resources/Release.xcconfig | |
| # 3. 깃허브 Secret에서 Firebase Plist 파일 생성하기 | |
| - name: Create Firebase Plist | |
| run: | | |
| mkdir -p Neki-iOS/APP/Sources/Resources/FirebaseConfig/Release | |
| echo "${{ secrets.FIREBASE_PLIST_RELEASE }}" | base64 --decode > Neki-iOS/APP/Sources/Resources/FirebaseConfig/Release/GoogleService-Info.plist | |
| # 4. SPM 매크로 지문 검증 우회 | |
| - name: Disable Macro Validation | |
| run: | | |
| defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES | |
| defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidation -bool YES | |
| # 5. SPM 의존성 사전 해결 | |
| - name: Resolve SPM Dependencies | |
| run: xcodebuild -resolvePackageDependencies -project ./Neki-iOS.xcodeproj -scheme Neki-iOS | |
| # 6. Match 인증서 저장소 접근을 위한 SSH 세팅 | |
| - name: Install SSH key for Match | |
| uses: webfactory/ssh-agent@v0.8.0 | |
| with: | |
| ssh-private-key: ${{ secrets.MATCH_SSH_KEY }} | |
| # 7. Ruby 및 Fastlane 세팅 (Gemfile 활용) | |
| - name: Setup Ruby and Install Gems | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| # 8. Fastlane 배포 실행 | |
| - name: Run Fastlane Release | |
| run: bundle exec fastlane release | |
| env: | |
| APP_IDENTIFIER: ${{ secrets.APP_IDENTIFIER }} | |
| SHARE_EXTENSION_APP_IDENTIFIER: ${{ secrets.SHARE_EXTENSION_APP_IDENTIFIER }} | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| TEAM_ID: ${{ secrets.TEAM_ID }} | |
| FASTLANE_ITC_TEAM_ID: ${{ secrets.FASTLANE_ITC_TEAM_ID }} | |
| ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }} | |
| ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }} | |
| ASC_KEY_CONTENT: ${{ secrets.ASC_KEY_CONTENT }} | |
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
| # 9. 배포 완료 후 서버로 최신 버전 정보 POST 요청 | |
| - name: Send Version Update to Server | |
| if: success() # 배포가 성공적으로 끝났을 때만 실행 | |
| run: | | |
| # Xcode 빌드 세팅에서 MARKETING_VERSION(앱 버전) 자동 추출 | |
| APP_VERSION=$(xcodebuild -showBuildSettings -project ./Neki-iOS.xcodeproj -scheme Neki-iOS | grep " MARKETING_VERSION " | sed 's/[ ]*MARKETING_VERSION = //') | |
| echo "추출된 최신 버전: $APP_VERSION" | |
| # 추출된 버전을 JSON 바디에 담아서 서버로 POST 요청 (minVersion은 필요시 추후 수정) | |
| curl -X PATCH "${{ secrets.APP_VERSION_API_ADDRESS }}" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{ | |
| \"minVersion\": \"1.0.0\", | |
| \"currentVersion\": \"$APP_VERSION\" | |
| }" | |
| # 10. Discord 결과 알림 (성공/실패 여부 전송) | |
| - name: Send Discord notification | |
| if: always() # 빌드 성공/실패 여부와 상관없이 무조건 실행 | |
| run: | | |
| if [ "${{ job.status }}" == "success" ]; then | |
| STATUS="✅ [Neki-iOS] release 브랜치 App Store Connect 배포 성공 🚀" | |
| else | |
| STATUS="❌ [Neki-iOS] release 브랜치 App Store Connect 배포 실패 😭" | |
| fi | |
| PAYLOAD=$(jq -n --arg content "$STATUS (${{ github.repository }})" '{content: $content}') | |
| curl -H "Content-Type: application/json" \ | |
| -X POST \ | |
| -d "$PAYLOAD" \ | |
| ${{ secrets.DISCORD_WEBHOOK_URL }} |