chore: 파일 끝 개행 추가 [no-ci] #19
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: Fastlane CI/CD | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| lane: | ||
| description: 'Fastlane lane to run' | ||
| required: true | ||
| default: 'build_qa_apk' | ||
| type: choice | ||
| options: | ||
| - build_qa_apk | ||
| - build_release_apk | ||
| - build_release_aab | ||
| - deploy_internal_test | ||
| - deploy_release | ||
| - ci_build | ||
| environment: | ||
| description: 'Build environment' | ||
| required: true | ||
| default: 'qa' | ||
| type: choice | ||
| options: | ||
| - qa | ||
| - production | ||
| version: | ||
| description: 'Release version (예: 3.2.0)' | ||
| required: false | ||
| type: string | ||
| track: | ||
| description: 'Play Store 배포 트랙' | ||
| required: false | ||
| default: 'internal' | ||
| type: choice | ||
| options: | ||
| - internal | ||
| - alpha | ||
| - beta | ||
| - production | ||
| # 일반 develop push는 android.yml에서 처리하므로 제거 | ||
| # push: | ||
| # branches: | ||
| # - develop | ||
| push: | ||
| tags: | ||
| - '[0-9]+.[0-9]+.[0-9]+' | ||
| jobs: | ||
| fastlane: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.2' | ||
| bundler-cache: true | ||
| - name: Install dependencies | ||
| run: | | ||
| bundle install | ||
| - name: Cache Gradle packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle- | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: gradle | ||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
| - name: Decode Keystore | ||
| run: | | ||
| echo "${{ secrets.KEYSTORE_CONTENT }}" | base64 --decode > keystore.jks | ||
| - name: Run fastlane | ||
| env: | ||
| DEV_BASE_URL: ${{ secrets.DEV_BASE_URL }} | ||
| PROD_BASE_URL: ${{ secrets.PROD_BASE_URL }} | ||
| KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }} | ||
| NAVER_MAPS_CLIENT_ID: ${{ secrets.NAVER_MAPS_CLIENT_ID }} | ||
| POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }} | ||
| POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }} | ||
| GOOGLE_SERVICE: ${{ secrets.GOOGLE_SERVICE }} | ||
| GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} | ||
| KEYSTORE_PATH: ${{ github.workspace }}/keystore.jks | ||
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | ||
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | ||
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | ||
| run: | | ||
| run: | | ||
| if [[ "${{ github.ref }}" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
| # Tag Push 감지 (예: 1.0.0) | ||
| TAG_NAME=${GITHUB_REF#refs/tags/} | ||
| VERSION=$TAG_NAME | ||
| echo "🚀 Tag Push detected: $TAG_NAME (Version: $VERSION)" | ||
| # 태그 배포는 기본적으로 internal 트랙으로 배포 (필요시 수정 가능) | ||
| bundle exec fastlane deploy_release version:$VERSION track:internal environment:production | ||
| elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | ||
| # workflow_dispatch만 지원 (수동 실행) | ||
| if [ "${{ github.event.inputs.lane }}" == "deploy_release" ]; then | ||
| # Release 배포 시 추가 파라미터 전달 | ||
| bundle exec fastlane ${{ github.event.inputs.lane }} environment:${{ github.event.inputs.environment }} version:${{ github.event.inputs.version }} track:${{ github.event.inputs.track }} | ||
| else | ||
| # 일반 빌드 | ||
| bundle exec fastlane ${{ github.event.inputs.lane }} environment:${{ github.event.inputs.environment }} | ||
| fi | ||
| fi | ||
| - name: Upload APK artifact | ||
| if: | | ||
| github.event_name == 'workflow_dispatch' && | ||
| (contains(github.event.inputs.lane, 'apk') || github.event.inputs.lane == 'build_qa_apk') | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: app-apk | ||
| path: | | ||
| app/build/outputs/apk/**/*.apk | ||
| retention-days: 7 | ||
| - name: Upload AAB artifact | ||
| if: | | ||
| startsWith(github.ref, 'refs/tags/') || | ||
| (github.event_name == 'workflow_dispatch' && | ||
| (contains(github.event.inputs.lane, 'aab') || github.event.inputs.lane == 'build_release_aab' || github.event.inputs.lane == 'deploy_internal_test' || github.event.inputs.lane == 'deploy_release')) | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: app-aab-${{ github.event.inputs.version || 'latest' }} | ||
| path: | | ||
| app/build/outputs/bundle/release/app-release.aab | ||
| retention-days: 30 | ||
| - name: Slack notification | ||
| if: always() | ||
| uses: 8398a7/action-slack@v3 | ||
| with: | ||
| status: ${{ job.status }} | ||
| fields: workflow,commit,repo,author,job,ref,took | ||
| env: | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||