Build CI 테스트(#181) #41
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
| name: Build Test | |
| on: | |
| pull_request: | |
| branches: | |
| - dev | |
| jobs: | |
| Build: | |
| runs-on: macos-15 | |
| steps: | |
| # 저장소의 코드를 체크아웃 | |
| - name: Checkout project | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Check LFS files | |
| run: git lfs ls-files | |
| - name: ⚙️ Write xcconfig | |
| run: | | |
| echo "GPT_API_KEY = $GPT_API_KEY" >> $CONFIG_FILE_PATH | |
| echo "KAKAO_NATIVE_APP_KEY = $KAKAO_NATIVE_APP_KEY" >> $CONFIG_FILE_PATH | |
| echo "NOTIFICATION_KEY = $NOTIFICATION_KEY" >> $CONFIG_FILE_PATH | |
| env: | |
| GPT_API_KEY: ${{ secrets.GPT_API_KEY }} | |
| KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }} | |
| NOTIFICATION_KEY: ${{ secrets.NOTIFICATION_KEY }} | |
| CONFIG_FILE_PATH: ${{ 'GimiFeedback/GimiFeedback/App/Config.xcconfig' }} | |
| - name: Decrypt GoogleService-Info.plist | |
| run: | | |
| echo "::add-mask::${GOOGLE_SERVICE_INFO_PWD}" | |
| gpg -d -o $DECRYPTED_GOOGLESERVICE_FILE_PATH \ | |
| --pinentry-mode=loopback \ | |
| --passphrase "$GOOGLE_SERVICE_INFO_PWD" \ | |
| .github/secrets/GoogleService-Info.plist.gpg | |
| env: | |
| GOOGLE_SERVICE_INFO_PWD: ${{ secrets.GOOGLE_SERVICE_INFO_PWD }} | |
| DECRYPTED_GOOGLESERVICE_FILE_PATH: ${{ 'GimiFeedback/GimiFeedback/App/GoogleService-Info.plist' }} | |
| - name: 🔨 set up xcode version | |
| run: | | |
| sudo xcode-select -s /Applications/Xcode_16.2.app | |
| - name: ✅ check xcode version | |
| run: | | |
| sudo xcodebuild -version | |
| - name: 🔍 Detect Default Scheme # 기본 scheme 자동 검지 | |
| id: detect_scheme | |
| run: | | |
| SCHEME=$(xcodebuild -list -json -project GimiFeedback/GimiFeedback.xcodeproj | jq -r '.project.schemes[0]') | |
| echo "Detected scheme: $SCHEME" | |
| echo "scheme=$SCHEME" >> "$GITHUB_OUTPUT" | |
| - name: 🔍 Detect Latest iPhone Simulator # 최신 사용 가능한 iPhone 시뮬레이터 검지 | |
| id: detect_latest_simulator | |
| run: | | |
| DEVICE=$(xcrun simctl list devices available | grep -Eo 'iPhone .* \([0-9A-F\-]+\)' | head -n 1) | |
| UDID=$(echo "$DEVICE" | grep -Eo '[0-9A-F\-]{36}') | |
| NAME=$(echo "$DEVICE" | cut -d '(' -f1 | xargs) | |
| echo "Detected simulator: $NAME ($UDID)" | |
| echo "sim_name=$NAME" >> "$GITHUB_OUTPUT" | |
| echo "sim_udid=$UDID" >> "$GITHUB_OUTPUT" | |
| - name: 🛠 Start xcode build | |
| run: | | |
| xcodebuild \ | |
| -project GimiFeedback/GimiFeedback.xcodeproj \ | |
| -scheme "${{ steps.detect_scheme.outputs.scheme }}" \ | |
| -sdk iphonesimulator \ | |
| -destination "platform=iOS Simulator,id=${{ steps.detect_latest_simulator.outputs.sim_udid }}" \ | |
| -skipPackagePluginValidation \ | |
| clean build |