-
Notifications
You must be signed in to change notification settings - Fork 3
[Feat] Firebase , CI/CD 추가 #79
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
Changes from all commits
3c7b2b5
ce4af65
c7e8b74
df17e8c
fdf33a8
d9aa007
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: Android CI | ||
|
|
||
| on: | ||
| push: # 코드 푸시 이벤트에 대한 설정 | ||
| branches: [ "develop" ] # "develop" 브랜치에 푸시될 때만 트리거된다. | ||
| pull_request: # 풀 리퀘스트 이벤트에 대한 설정 | ||
| branches: [ "develop" ] # "develop" 브랜치로의 풀 리퀘스트가 생성될 때만 트리거된다. | ||
|
|
||
| jobs: # CI에서 수행할 작업을 정의한다. | ||
| ci-build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: gradle | ||
|
|
||
| - name: Cache Gradle packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle- | ||
|
|
||
| - name: Generate local.properties | ||
| run: | | ||
| echo '${{ secrets.LOCAL_PROPERTIES }}' >> ./local.properties | ||
|
|
||
| - name: Generate google-services.json | ||
| run: | | ||
| echo '${{ secrets.GOOGLE_SERVICES }}' >> ./app/google-services.json | ||
|
|
||
| # - name: Code style checks | ||
| # run: | | ||
| # ./gradlew detekt | ||
|
|
||
| - name: Run build | ||
| run: ./gradlew assembleDebug --stacktrace | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: Build & upload to Firebase App Distribution | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| cd-build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Cache Gradle packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle- | ||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Prepare keystore dir | ||
| run: mkdir -p keystore | ||
|
|
||
| - name: Decode And Save Keystore Base64 | ||
| run: | | ||
| echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > keystore/keystore.jks | ||
| - name: Decode And Save Debug Keystore Base64 | ||
| run: | | ||
| echo "${{ secrets.DEBUG_KEYSTORE_BASE64 }}" | base64 -d > debug.keystore | ||
ikseong00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Generate local.properties | ||
| run: | | ||
| echo '${{ secrets.LOCAL_PROPERTIES }}' >> ./local.properties | ||
| - name: Generate google-services.json | ||
| run: | | ||
| echo '${{ secrets.GOOGLE_SERVICES }}' >> ./app/google-services.json | ||
ikseong00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Build debug APK | ||
| run: ./gradlew assembleDebug | ||
|
|
||
| - name: Upload artifact to Firebase App Distribution | ||
| uses: wzieba/Firebase-Distribution-Github-Action@v1 | ||
| with: | ||
| appId: ${{ secrets.FIREBASE_APP_ID }} | ||
| serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | ||
| groups: testers | ||
| file: app/build/outputs/apk/debug/app-debug.apk | ||
| # releaseNotes: ${{ steps.firebase_release_note.outputs.notes }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ plugins { | |
| alias(libs.plugins.kotlin.android) | ||
| alias(libs.plugins.kotlin.compose) | ||
| alias(libs.plugins.kotlin.serialization) | ||
ikseong00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| alias(libs.plugins.firebase.crashlytics) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainCI/CD와 Firebase 구성 검증 스크립트 제안 워크플로우와 설정이 잘 맞물리는지 자동 점검해 보시죠. 아래 스크립트는 플러그인/파일/NDK 사용 여부 등을 빠르게 확인합니다. Also applies to: 119-121, 36-43 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Check google-services plugin usage =="
rg -n $'plugins\\s*\\{[\\s\\S]*?\\}' -A 50 -g "*build.gradle*" -g "*build.gradle.kts*" | rg -n "com.google.gms.google-services" || echo "google-services plugin not found in any module."
echo "== Check google-services.json existence under app =="
fd -H "google-services.json" -a || echo "google-services.json not found in repo (might be injected in CI)."
echo "== Check Crashlytics NDK vs native code presence =="
fd -t d "cpp|jni|jniLibs" -HI || true
rg -n "externalNativeBuild|ndk\\s*\\{" -g "*build.gradle*" -g "*build.gradle.kts*" || echo "No obvious NDK build config found."
echo "== Check accidental Espresso implementation in app module =="
rg -n "implementation\\(.*espresso" app/build.gradle.kts || echo "No Espresso implementation found in app/build.gradle.kts (good)."Length of output: 1031 CI/CD 및 Firebase 설정 검증 필요 스크립트 실행 결과 다음 문제가 확인되었습니다:
해결 방안:
🤖 Prompt for AI Agents💡 Verification agent 🧩 Analysis chainFirebase Analytics/Crashlytics 연동에 Crashlytics 플러그인은 추가되었지만, 아래처럼 플러그인을 함께 적용해 주세요. plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.firebase.crashlytics)
+ id("com.google.gms.google-services")
id("com.google.dagger.hilt.android") // Hilt 플러그인 추가
kotlin("kapt") // Hilt를 위한 kapt 추가
}또한 google-services 플러그인 적용 여부와 🏁 Script executed: #!/usr/bin/env bash
set -e
echo "1. Build 스크립트에서 com.google.gms.google-services 플러그인 검색:"
rg -n "com\\.google\\.gms\\.google-services" --glob "*.{gradle,gradle.kts}" || true
echo "2. 버전 카탈로그(libs.versions.toml)에서 google-services alias 검색:"
rg -n "google-services" --glob "libs.versions.toml" || true
echo "3. 프로젝트에서 google-services.json 파일 존재 확인:"
fd google-services.json || trueLength of output: 512
Firebase Analytics/Crashlytics 연동을 제대로 하려면 아래 항목을 반영해주세요: • app/build.gradle.kts → plugins 블록에 플러그인 추가 plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.firebase.crashlytics)
+ id("com.google.gms.google-services")
id("com.google.dagger.hilt.android")
kotlin("kapt")
}• app/google-services.json 파일이 프로젝트에 존재하는지 확인 위 수정 사항들을 적용하면 Firebase 설정이 빌드에 정상 반영됩니다! 🤙 🤖 Prompt for AI Agents |
||
| id("com.google.dagger.hilt.android") // Hilt 플러그인 추가 | ||
| kotlin("kapt") // Hilt를 위한 kapt 추가 | ||
| } | ||
|
|
@@ -32,6 +33,24 @@ android { | |
|
|
||
| } | ||
|
|
||
| signingConfigs { | ||
| val debugKeystore = rootProject.file("debug.keystore") | ||
| if (debugKeystore.exists()) { | ||
| getByName("debug") { | ||
| storeFile = debugKeystore | ||
| storePassword = "android" | ||
| keyAlias = "androiddebugkey" | ||
| keyPassword = "android" | ||
| } | ||
| } | ||
| getByName("debug") { | ||
| storeFile = file("$rootDir/debug.keystore") | ||
| storePassword = "android" | ||
| keyAlias = "androiddebugkey" | ||
| keyPassword = "android" | ||
| } | ||
| } | ||
|
|
||
| buildTypes { | ||
| release { | ||
| isMinifyEnabled = false | ||
|
|
@@ -98,12 +117,17 @@ dependencies { | |
| // Kakao SDK | ||
| implementation("com.kakao.sdk:v2-all:2.20.6") | ||
| implementation("com.kakao.sdk:v2-user:2.20.6") // 카카오 로그인 API 모듈 | ||
| implementation ("com.kakao.maps.open:android:2.12.8") // 카카오 맵 API | ||
| implementation("com.kakao.maps.open:android:2.12.8") // 카카오 맵 API | ||
|
|
||
| // coil | ||
| implementation(libs.coil.compose) | ||
| implementation(libs.coil.network.okhttp) | ||
| implementation(libs.coil.svg) | ||
|
|
||
| // Firebase | ||
| implementation(platform(libs.firebase.bom)) | ||
| implementation(libs.firebase.crashlytics.ndk) | ||
| implementation(libs.firebase.analytics) | ||
|
Comment on lines
+128
to
+130
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Crashlytics NDK 의존성 재검토 + 디버그 수집 비활성화 권장
아래처럼 교체/추가하는 것을 권장합니다. 의존성 교체: implementation(platform(libs.firebase.bom))
-implementation(libs.firebase.crashlytics.ndk)
+implementation("com.google.firebase:firebase-crashlytics-ktx")
implementation(libs.firebase.analytics)빌드타입별 수집 설정(예시): android {
buildTypes {
debug {
manifestPlaceholders["firebaseCrashlyticsCollectionEnabled"] = "false"
}
release {
manifestPlaceholders["firebaseCrashlyticsCollectionEnabled"] = "true"
}
}
}NDK를 실제로 사용 중이라면, 네이티브 심볼 업로드 설정도 함께 고려해 주세요. firebaseCrashlytics {
nativeSymbolUploadEnabled = true
}🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| // Hilt를 사용할 때 필요한 Annotation Processor | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'cache: gradle' option in setup-java is redundant since you're already using a separate Gradle cache action below. Remove this line to avoid potential caching conflicts.