Feat/Singleton Token #49
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
| # CI.yml | |
| name: Ace Client CI | |
| # 워크플로우 트리거 설정 | |
| on: | |
| pull_request: | |
| # 어떤 브랜치에서 시작하여 어떤 브랜치를 향하든 모든 Pull Request에 대해 트리거합니다. | |
| types: [ opened, synchronize, reopened ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # PR의 경우, PR이 draft 상태가 아닐 때만 실행합니다. | |
| if: github.event.pull_request.draft == false | |
| steps: | |
| - name: 코드 체크아웃 | |
| uses: actions/checkout@v4 | |
| - name: JDK 17 설정 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Gradle 캐시 설정 | |
| 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: google-services.json 설정 | |
| run: | | |
| echo "Setting up google-services.json..." | |
| echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./composeApp/google-services.json | |
| if [ -f ./composeApp/google-services.json ]; then | |
| echo "google-services.json successfully created at ./composeApp/google-services.json" | |
| else | |
| echo "Error: google-services.json not found at ./composeApp/google-services.json" | |
| exit 1 | |
| fi | |
| shell: bash | |
| env: | |
| GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
| - name: local.properties 설정 (Android용) | |
| run: | | |
| echo "BASE_URL=${{ secrets.BASE_URL }}" >> local.properties | |
| - name: NetworkConfig.local.kt 설정 (iOS용) | |
| run: | | |
| mkdir -p core/network/src/iosMain/kotlin/com/nexters/emotia/network/ | |
| cat > core/network/src/iosMain/kotlin/com/nexters/emotia/network/NetworkConfig.local.kt << EOF | |
| package com.nexters.emotia.network | |
| internal object NetworkConfigLocal { | |
| const val BASE_URL = "${{ secrets.BASE_URL }}" | |
| } | |
| EOF | |
| - name: network_security_config.xml 설정 | |
| run: | | |
| BASE_DOMAIN=$(echo "${{ secrets.BASE_URL }}" | sed 's/:[0-9]*$//') | |
| cat > composeApp/src/main/res/xml/network_security_config.xml << EOF | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <network-security-config> | |
| <domain-config cleartextTrafficPermitted="true"> | |
| <domain includeSubdomains="true">$BASE_DOMAIN</domain> | |
| </domain-config> | |
| </network-security-config> | |
| EOF | |
| - name: 디버그 APK 빌드 | |
| run: ./gradlew assembleDebug | |
| - name: 빌드 결과 아티팩트 저장 (선택 사항) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: debug-apk | |
| path: composeApp/build/intermediates/apk/debug/composeApp-debug.apk | |
| - name: Slack 알림 (빌드 성공) | |
| if: success() | |
| uses: 8398a7/action-slack@v3 | |
| with: | |
| status: success | |
| fields: workflow,job,commit,repo,author,took,ref | |
| author_name: GitHub Actions | |
| text: "✅ CI 빌드 성공! PR: #${{ github.event.pull_request.number }} - `${{ github.event.pull_request.title }}`" # 메시지 내용 | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| - name: Slack 알림 (빌드 실패) | |
| if: failure() | |
| uses: 8398a7/action-slack@v3 | |
| with: | |
| status: failure | |
| fields: workflow,job,commit,repo,author,took,ref | |
| author_name: GitHub Actions | |
| text: "❌ CI 빌드 실패! PR: #${{ github.event.pull_request.number }} - `${{ github.event.pull_request.title }}`" | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |