-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT/#226]Git Action CI/CD를 구축합니다. #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b3f726b
[ADD/#226] CI Workflow 추가
MoonsuKang 99082f9
[ADD/#226] CD Workflow 추가
MoonsuKang d1f582a
[ADD/#226] FireBase App Distribution 추가
MoonsuKang 2a4c691
[REFACTOR/#226] v2 -> v4
MoonsuKang 346b9fc
[REFACTOR/#239] editorconfig 수정
MoonsuKang fcda905
[REFACTOR/#239] 코드 정리 및 불필요한 공백 제거(Ktlint Formatting)
MoonsuKang c467ec2
[REFACTOR/#226] CI/CD URL dot(.) 형태로 받게 수정
MoonsuKang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| name: Clody CD | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ staging ] | ||
|
|
||
| jobs: | ||
| cd: | ||
| name: Continuous Deployment | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| # Checkout | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # Gradle Cache | ||
| - name: Cache Gradle dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle- | ||
|
|
||
| # JDK | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: 17 | ||
| distribution: 'corretto' | ||
| cache: gradle | ||
|
|
||
| # Android SDK | ||
| - name: Setup Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
|
|
||
| # gradlew 권한 | ||
| - name: Change gradlew permissions | ||
| run: chmod +x gradlew | ||
|
|
||
| # google-services.json | ||
| - name: Decode google-services.json | ||
| env: | ||
| FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }} | ||
| run: echo $FIREBASE_SECRET | base64 --decode > app/google-services.json | ||
|
|
||
| # local.properties | ||
| - name: Generate local.properties | ||
| env: | ||
| BASE_URL: ${{ secrets.BASE_URL }} | ||
| KAKAO_API_KEY: ${{ secrets.KAKAO_API_KEY }} | ||
| AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }} | ||
| GOOGLE_ADMOB_APP_ID: ${{ secrets.GOOGLE_ADMOB_APP_ID }} | ||
| GOOGLE_ADMOB_UNIT_ID: ${{ secrets.GOOGLE_ADMOB_UNIT_ID }} | ||
| run: | | ||
| echo "baseUrl=$BASE_URL" >> local.properties | ||
| echo "kakaoApiKey=$KAKAO_API_KEY" >> local.properties | ||
| echo "amplitudeApiKey=$AMPLITUDE_API_KEY" >> local.properties | ||
| echo "googleAdmobAppId=$GOOGLE_ADMOB_APP_ID" >> local.properties | ||
| echo "googleAdmobUnitId=$GOOGLE_ADMOB_UNIT_ID" >> local.properties | ||
|
|
||
| # Release AAB 빌드 | ||
| - name: Build Release AAB | ||
| run: ./gradlew bundleRelease --stacktrace | ||
|
|
||
| # Firebase 인증 | ||
| - name: Set up Firebase Service Account Credentials | ||
| env: | ||
| GOOGLE_APPLICATION_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }} | ||
| run: | | ||
| echo "$GOOGLE_APPLICATION_CREDENTIALS_JSON" | base64 --decode > $HOME/firebase-credentials.json | ||
| export GOOGLE_APPLICATION_CREDENTIALS=$HOME/firebase-credentials.json | ||
|
|
||
| # Firebase App Distribution | ||
| - name: Upload AAB to Firebase App Distribution | ||
| env: | ||
| FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} | ||
| run: | | ||
| firebase appdistribution:distribute app/build/outputs/bundle/release/app-release.aab \ | ||
| --app "$FIREBASE_APP_ID" \ | ||
| --release-notes "🍀 새로운 테스트 버전이 업로드되었습니다!" \ | ||
| --groups "clody-tester-group" | ||
|
|
||
| # Discord Notification | ||
| - name: Notify Discord | ||
| env: | ||
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
| run: | | ||
| curl -H "Content-Type: application/json" \ | ||
| -X POST \ | ||
| -d '{"content": "🍀 새로운 테스트 버전이 업로드되었습니다!"}' \ | ||
| $DISCORD_WEBHOOK_URL |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| name: Clody CI | ||
|
|
||
| # 언제 동작할지 설정 | ||
| on: | ||
| pull_request: | ||
| branches: [ develop ] | ||
| paths: | ||
| - 'app/**' # app 모듈 내부 변경 | ||
| - 'build.gradle' # 최상위 build.gradle | ||
| - '**/*.kt' # 모든 Kotlin 파일 변경 | ||
|
|
||
| # 공통 작업 디렉토리 설정 | ||
| defaults: | ||
| run: | ||
| working-directory: ./ | ||
|
|
||
| # Job 정의 | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest # Ubuntu 최신 이미지에서 실행 | ||
|
|
||
| steps: | ||
| # Gradle 캐싱 (속도 향상) | ||
| - name: Cache Gradle packages | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('gradle.properties', '**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle- | ||
|
|
||
| # Android SDK 캐싱 | ||
| - name: Cache Android SDK | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: ~/.android | ||
| key: ${{ runner.os }}-android | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # GitHub Repo 코드 Checkout | ||
| - name: Checkout the code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # JDK 17 설치 (Android 공식 권장 버전) | ||
| - name: Setup JDK | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'corretto' | ||
| java-version: '17' | ||
|
|
||
| # Android SDK 설치 | ||
| - name: Setup Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
|
|
||
| # gradlew 실행 권한 부여 | ||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| # Firebase google-services.json 복호화 및 설정 | ||
| - name: Decode google-services.json | ||
| env: | ||
| FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }} # base64로 암호화된 json 사용 | ||
| run: echo $FIREBASE_SECRET | base64 --decode > app/google-services.json | ||
|
|
||
| # local.properties 생성 | ||
| - name: Generate local.properties | ||
| env: | ||
| BASE_URL: ${{ secrets.BASE_URL }} | ||
| KAKAO_API_KEY: ${{ secrets.KAKAO_API_KEY }} | ||
| AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }} | ||
| GOOGLE_ADMOB_APP_ID: ${{ secrets.GOOGLE_ADMOB_APP_ID }} | ||
| GOOGLE_ADMOB_UNIT_ID: ${{ secrets.GOOGLE_ADMOB_UNIT_ID }} | ||
| run: | | ||
| echo "baseUrl=$BASE_URL" >> local.properties | ||
| echo "kakaoApiKey=$KAKAO_API_KEY" >> local.properties | ||
| echo "amplitudeApiKey=$AMPLITUDE_API_KEY" >> local.properties | ||
| echo "googleAdmobAppId=$GOOGLE_ADMOB_APP_ID" >> local.properties | ||
| echo "googleAdmobUnitId=$GOOGLE_ADMOB_UNIT_ID" >> local.properties | ||
|
|
||
| # ------- Build & Lint ------- | ||
|
|
||
| # Ktlint 코드 스타일 검사 | ||
| - name: Run ktlintCheck | ||
| run: ./gradlew --no-daemon --configuration-cache ktlintCheck | ||
|
|
||
| # Android Lint 검사 | ||
| - name: Run Android Lint | ||
| run: ./gradlew --no-daemon --configuration-cache lint | ||
|
|
||
| # Debug 빌드 생성 (CI Build 성공 여부 확인) | ||
| - name: Assemble Debug Build | ||
| run: ./gradlew --no-daemon --configuration-cache assembleDebug | ||
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 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 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.