From 7b129af20d674a3a8411a78d2999d2253947b806 Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Sun, 30 Nov 2025 22:21:16 +0900 Subject: [PATCH 01/11] =?UTF-8?q?feat:=20Firebase=20App=20Distribution=20?= =?UTF-8?q?=EC=84=B8=ED=8C=85=20=EB=B0=8F=20=EA=B5=AC=ED=98=84(release=20A?= =?UTF-8?q?PK)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 16 ++++++++++++++-- build.gradle.kts | 1 + gradle/libs.versions.toml | 4 +++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1337bab20..976631c01 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,4 @@ +import com.google.firebase.appdistribution.gradle.firebaseAppDistribution import java.util.Properties plugins { @@ -5,6 +6,7 @@ plugins { alias(libs.plugins.kotlin.android) alias(libs.plugins.google.services) alias(libs.plugins.firebase.crashlytics) + alias(libs.plugins.firebase.app.distribution) alias(libs.plugins.hilt.android) id("kotlin-parcelize") id("kotlin-android") @@ -44,7 +46,7 @@ android { } buildTypes { - release { + getByName("release") { val p = Properties() p.load(project.rootProject.file("local.properties").reader()) @@ -64,7 +66,7 @@ android { proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } - debug { + getByName("debug") { applicationIdSuffix = ".debug" // isDebuggable = false @@ -83,6 +85,16 @@ android { manifestPlaceholders["NAVER_MAPS_CLIENT_ID"] = naverMapsClientID isMinifyEnabled = false + + firebaseAppDistribution { + serviceCredentialsFile = "$rootDir/serviceAccountKey.json" + artifactType = "APK" + groups = "eat-ssu-android-qa" + releaseNotes = """ + Debug 빌드 - 버전 ${defaultConfig.versionName} (${defaultConfig.versionCode}) + 내부 테스트용 빌드입니다. + """.trimIndent() + } } } diff --git a/build.gradle.kts b/build.gradle.kts index b28a406f7..79583bb3b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,6 +5,7 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.google.services) apply false alias(libs.plugins.firebase.crashlytics) apply false + alias(libs.plugins.firebase.app.distribution) apply false alias(libs.plugins.hilt.android) apply false } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 867868e7e..d1c28a7d0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -49,6 +49,7 @@ androidxHilt = "1.2.0" play-services-base = "18.0.1" firebase-bom = "32.6.0" firebase-crashlytics = "2.9.9" +firebase-app-distribution = "5.2.0" google-services = "4.4.2" timber = "5.0.1" kotlin-android = "1.9.25" @@ -161,4 +162,5 @@ android-library = { id = "com.android.library", version.ref = "android" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-android" } google-services = { id = "com.google.gms.google-services", version.ref = "google-services" } firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebase-crashlytics" } -hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } \ No newline at end of file +hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } +firebase-app-distribution = { id = "com.google.firebase.appdistribution", version.ref = "firebase-app-distribution" } \ No newline at end of file From f9286fdc86c46761cc52bf65541fedcbb1dca0e2 Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Wed, 3 Dec 2025 00:09:22 +0900 Subject: [PATCH 02/11] =?UTF-8?q?feat:=20Debug=20=EB=B0=B0=ED=8F=AC?= =?UTF-8?q?=EA=B0=80=20=EC=95=84=EB=8B=8C=20Release=20AAB=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=A0=84=EC=86=A1=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=9D=B4=EB=8F=99=20=EB=B0=8F=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 976631c01..d0c62596b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -64,6 +64,16 @@ android { isShrinkResources = true isMinifyEnabled = true proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + + firebaseAppDistribution { + serviceCredentialsFile = "$rootDir/serviceAccountKey.json" + artifactType = "AAB" // release는 AAB 파일 전송 + groups = "eat-ssu-android-qa" + releaseNotes = """ + Release 빌드 - 버전 ${defaultConfig.versionName} (${defaultConfig.versionCode}) + 프로덕션 테스트 빌드입니다. + """.trimIndent() + } } getByName("debug") { @@ -85,16 +95,6 @@ android { manifestPlaceholders["NAVER_MAPS_CLIENT_ID"] = naverMapsClientID isMinifyEnabled = false - - firebaseAppDistribution { - serviceCredentialsFile = "$rootDir/serviceAccountKey.json" - artifactType = "APK" - groups = "eat-ssu-android-qa" - releaseNotes = """ - Debug 빌드 - 버전 ${defaultConfig.versionName} (${defaultConfig.versionCode}) - 내부 테스트용 빌드입니다. - """.trimIndent() - } } } From 1f59c4186849713cd7ce28272c1151e59bd6a9d8 Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Wed, 3 Dec 2025 00:19:37 +0900 Subject: [PATCH 03/11] =?UTF-8?q?feat:=20APK=20=EC=A0=84=EC=86=A1=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d0c62596b..778a31263 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -67,11 +67,11 @@ android { firebaseAppDistribution { serviceCredentialsFile = "$rootDir/serviceAccountKey.json" - artifactType = "AAB" // release는 AAB 파일 전송 + artifactType = "APK" groups = "eat-ssu-android-qa" releaseNotes = """ Release 빌드 - 버전 ${defaultConfig.versionName} (${defaultConfig.versionCode}) - 프로덕션 테스트 빌드입니다. + 프로덕션 테스트(APK) 빌드입니다. """.trimIndent() } } From 544400fc7de4da2366f1e143051bbe58cc39c439 Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Wed, 3 Dec 2025 00:38:33 +0900 Subject: [PATCH 04/11] =?UTF-8?q?feat:=20CI/CD=20=EA=B0=80=EB=8A=A5?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=BD=94=EB=93=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 778a31263..684d67b29 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -66,14 +66,31 @@ android { proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") firebaseAppDistribution { - serviceCredentialsFile = "$rootDir/serviceAccountKey.json" + + val credentials = System.getenv("FIREBASE_CREDENTIALS") + ?: p.getProperty("FIREBASE_CREDENTIALS") + + if (credentials != null) { + // CI/CD용 임시 파일 생성 + val tempFile = File("$buildDir/intermediates/firebase/serviceAccountKey.json") + tempFile.parentFile.mkdirs() + tempFile.writeText(credentials) + + // Firebase에 전달 + serviceCredentialsFile = tempFile.absolutePath + } else { + throw GradleException("FIREBASE_CREDENTIALS is not set.") + } + artifactType = "APK" groups = "eat-ssu-android-qa" releaseNotes = """ - Release 빌드 - 버전 ${defaultConfig.versionName} (${defaultConfig.versionCode}) - 프로덕션 테스트(APK) 빌드입니다. - """.trimIndent() + Release 빌드 - 버전 ${defaultConfig.versionName} (${defaultConfig.versionCode}) + 프로덕션 테스트 빌드입니다. + """.trimIndent() } + + } getByName("debug") { From 1ff4b769ed1dbd7d7b473f29c67a2ccd13a6ee6f Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Wed, 3 Dec 2025 00:49:06 +0900 Subject: [PATCH 05/11] =?UTF-8?q?feat:=20gitignore=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 55db79b45..a29d982cc 100644 --- a/.gitignore +++ b/.gitignore @@ -98,4 +98,9 @@ lint/tmp/ .DS_Store ._.DS_Store **/.DS_Store -**/._.DS_Store \ No newline at end of file +**/._.DS_Store + +# Firebase service account +serviceAccountKey.json +app/serviceAccountKey.json +**/serviceAccountKey.json \ No newline at end of file From 522c001d7bdccd5fc660ffcb922eca48ff538b72 Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Wed, 3 Dec 2025 00:49:23 +0900 Subject: [PATCH 06/11] =?UTF-8?q?feat:=20cicd=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EC=97=90=20app=20firebase-app-distribution=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/android.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 48da04aaa..1a2579a8d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -38,7 +38,7 @@ jobs: env: DEV_BASE_URL: ${{ secrets.DEV_BASE_URL }} PROD_BASE_URL: ${{ secrets.PROD_BASE_URL }} - KAKAO_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }} + KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }} NAVER_MAPS_CLIENT_ID: ${{ secrets.NAVER_MAPS_CLIENT_ID }} run: | @@ -58,3 +58,9 @@ jobs: run: chmod +x gradlew - name: Build with Gradle run: ./gradlew build + + - name: Upload to Firebase App Distribution (Release) + run: ./gradlew appDistributionUploadRelease + env: + FIREBASE_CREDENTIALS: ${{ secrets.FIREBASE_CREDENTIALS }} + From 185fbb0e119c3ddd8422239a773d413eaa1b508c Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Wed, 3 Dec 2025 00:49:38 +0900 Subject: [PATCH 07/11] =?UTF-8?q?feat:=20buildDir=20=EC=A0=91=EA=B7=BC=20?= =?UTF-8?q?=EB=B0=A9=EC=8B=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 684d67b29..6fb7a6d21 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -72,7 +72,9 @@ android { if (credentials != null) { // CI/CD용 임시 파일 생성 - val tempFile = File("$buildDir/intermediates/firebase/serviceAccountKey.json") + val tempFile = + layout.buildDirectory.file("intermediates/firebase/serviceAccountKey.json") + .get().asFile tempFile.parentFile.mkdirs() tempFile.writeText(credentials) @@ -89,8 +91,6 @@ android { 프로덕션 테스트 빌드입니다. """.trimIndent() } - - } getByName("debug") { From 96c82d0c0cd5c9c957c3f8bbf8c4561b27238498 Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Wed, 3 Dec 2025 00:52:32 +0900 Subject: [PATCH 08/11] =?UTF-8?q?feat:=20gitignore=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitignore b/.gitignore index a29d982cc..e1c6a337f 100644 --- a/.gitignore +++ b/.gitignore @@ -99,8 +99,3 @@ lint/tmp/ ._.DS_Store **/.DS_Store **/._.DS_Store - -# Firebase service account -serviceAccountKey.json -app/serviceAccountKey.json -**/serviceAccountKey.json \ No newline at end of file From 53364be60e618f5f165e5331ccd83e6dbb948350 Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Wed, 3 Dec 2025 00:55:51 +0900 Subject: [PATCH 09/11] =?UTF-8?q?feat:=20cicd=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/android.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 1a2579a8d..6853f1649 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -58,9 +58,10 @@ jobs: run: chmod +x gradlew - name: Build with Gradle run: ./gradlew build + env: + FIREBASE_CREDENTIALS: ${{ secrets.FIREBASE_CREDENTIALS }} - name: Upload to Firebase App Distribution (Release) run: ./gradlew appDistributionUploadRelease env: FIREBASE_CREDENTIALS: ${{ secrets.FIREBASE_CREDENTIALS }} - From 94754f08c94abd26d1d16c67317215b9d9a94c7c Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Tue, 23 Dec 2025 23:37:26 +0900 Subject: [PATCH 10/11] =?UTF-8?q?feat:=20debug=EB=AA=A8=EB=93=9C=EB=8F=84?= =?UTF-8?q?=20apk=20=ED=8C=8C=EC=9D=BC=20=EC=A0=84=EB=8B=AC=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6fb7a6d21..0f00e4ae7 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -66,12 +66,15 @@ android { proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") firebaseAppDistribution { + // Firebase App Distribution 서비스 계정 JSON을 -Pcredentials 또는 환경변수(FIREBASE_CREDENTIALS) 로 주입받기 위한 설정 + val firebaseCredentials: String? = + (project.findProperty("credentials") as String?) + ?: System.getenv("FIREBASE_CREDENTIALS") - val credentials = System.getenv("FIREBASE_CREDENTIALS") - ?: p.getProperty("FIREBASE_CREDENTIALS") + val credentials = firebaseCredentials - if (credentials != null) { - // CI/CD용 임시 파일 생성 + if (!credentials.isNullOrBlank()) { + // CI/CD용 임시 파일 생성 (GitHub Secrets 등으로 전달된 JSON 문자열 사용) val tempFile = layout.buildDirectory.file("intermediates/firebase/serviceAccountKey.json") .get().asFile @@ -81,7 +84,7 @@ android { // Firebase에 전달 serviceCredentialsFile = tempFile.absolutePath } else { - throw GradleException("FIREBASE_CREDENTIALS is not set.") + println("Firebase App Distribution credentials not provided. Skipping serviceCredentialsFile configuration.") } artifactType = "APK" @@ -112,6 +115,36 @@ android { manifestPlaceholders["NAVER_MAPS_CLIENT_ID"] = naverMapsClientID isMinifyEnabled = false + + firebaseAppDistribution { + // Firebase App Distribution 서비스 계정 JSON을 -Pcredentials 또는 환경변수(FIREBASE_CREDENTIALS) 로 주입받기 위한 설정 + val firebaseCredentials: String? = + (project.findProperty("credentials") as String?) + ?: System.getenv("FIREBASE_CREDENTIALS") + + val credentials = firebaseCredentials + + if (!credentials.isNullOrBlank()) { + // CI/CD용 임시 파일 생성 (GitHub Secrets 등으로 전달된 JSON 문자열 사용) + val tempFile = + layout.buildDirectory.file("intermediates/firebase/serviceAccountKey_debug.json") + .get().asFile + tempFile.parentFile.mkdirs() + tempFile.writeText(credentials) + + // Firebase에 전달 + serviceCredentialsFile = tempFile.absolutePath + } else { + println("Firebase App Distribution credentials not provided for debug.") + } + + artifactType = "APK" + groups = "eat-ssu-android-qa" + releaseNotes = """ + Debug 빌드 - 버전 ${defaultConfig.versionName} (${defaultConfig.versionCode}) + 디버그 테스트 빌드입니다. + """.trimIndent() + } } } From 33fdfb55abbed15df9dd6f5410fd2c4009e76a87 Mon Sep 17 00:00:00 2001 From: kangyuri1114 Date: Wed, 24 Dec 2025 01:36:46 +0900 Subject: [PATCH 11/11] =?UTF-8?q?feat:=20gradle=EB=B0=A9=EC=8B=9D=EC=9D=B4?= =?UTF-8?q?=20=EC=95=84=EB=8B=8C=20firebase=20cli=EB=A5=BC=20=ED=99=9C?= =?UTF-8?q?=EC=9A=A9=ED=95=9C=20app=20distribution=20=EB=B0=A9=EC=8B=9D?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/android.yml | 40 +++++++++++++----- .github/workflows/qa_apk_firebase.yml | 60 ++++++++++++++++++++++++++ app/build.gradle.kts | 61 --------------------------- build.gradle.kts | 1 - gradle/libs.versions.toml | 2 - 5 files changed, 89 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/qa_apk_firebase.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 6853f1649..6972b5888 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -2,13 +2,21 @@ name: Android CI on: push: - branches: [ "develop" ] + branches: + - develop pull_request: - branches: [ "develop" ] + branches: + - develop jobs: build: - + # develop push는 허용, develop으로의 PR 중 release/* 브랜치에서 온 PR만 허용 + if: > + github.event_name == 'push' || + ( + github.event_name == 'pull_request' && + startsWith(github.event.pull_request.head.ref, 'release/') + ) runs-on: ubuntu-latest steps: @@ -56,12 +64,22 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build - env: - FIREBASE_CREDENTIALS: ${{ secrets.FIREBASE_CREDENTIALS }} - - name: Upload to Firebase App Distribution (Release) - run: ./gradlew appDistributionUploadRelease - env: - FIREBASE_CREDENTIALS: ${{ secrets.FIREBASE_CREDENTIALS }} + - name: Assemble Debug APK + run: ./gradlew assembleDebug + + - name: Assemble Release APK + run: ./gradlew assembleRelease + + - name: Upload Debug APK artifact + uses: actions/upload-artifact@v4 + with: + name: debug-apk + path: app/build/outputs/apk/debug/*.apk + + - name: Upload Release APK artifact + uses: actions/upload-artifact@v4 + with: + name: release-apk + path: app/build/outputs/apk/release/*.apk + diff --git a/.github/workflows/qa_apk_firebase.yml b/.github/workflows/qa_apk_firebase.yml new file mode 100644 index 000000000..4ff9327d1 --- /dev/null +++ b/.github/workflows/qa_apk_firebase.yml @@ -0,0 +1,60 @@ +name: Upload QA APK to Firebase App Distribution + +# release 브랜치를 대상으로 하는 PR 존재 + 그 PR의 소스 브랜치가 release/* + 실행된 Android CI가 성공했을 때 실행하는 워크플로우 +on: + workflow_run: + workflows: + - Android CI + branches: [ "release" ] + types: + - completed + +jobs: + firebase-distribution: + if: > + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.pull_requests != null && + github.event.workflow_run.pull_requests[0] != null && + startsWith(github.event.workflow_run.pull_requests[0].head.ref, 'release/') + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Download Debug APK artifact + uses: actions/download-artifact@v4 + with: + name: debug-apk + path: apk/debug + + - name: Download Release APK artifact + uses: actions/download-artifact@v4 + with: + name: release-apk + path: apk/release + + - name: Install Firebase CLI + run: npm install -g firebase-tools + + - name: Upload Debug APK to Firebase App Distribution + run: | + firebase appdistribution:distribute apk/debug/*.apk \ + --app ${{ secrets.FIREBASE_APP_ID }} \ + --groups eat-ssu-android-qa + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_CI_TOKEN }} + + - name: Upload Release APK to Firebase App Distribution + run: | + firebase appdistribution:distribute apk/release/*.apk \ + --app ${{ secrets.FIREBASE_APP_ID }} \ + --groups eat-ssu-android-qa + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_CI_TOKEN }} diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0f00e4ae7..6968ee60b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,4 +1,3 @@ -import com.google.firebase.appdistribution.gradle.firebaseAppDistribution import java.util.Properties plugins { @@ -6,7 +5,6 @@ plugins { alias(libs.plugins.kotlin.android) alias(libs.plugins.google.services) alias(libs.plugins.firebase.crashlytics) - alias(libs.plugins.firebase.app.distribution) alias(libs.plugins.hilt.android) id("kotlin-parcelize") id("kotlin-android") @@ -65,35 +63,6 @@ android { isMinifyEnabled = true proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") - firebaseAppDistribution { - // Firebase App Distribution 서비스 계정 JSON을 -Pcredentials 또는 환경변수(FIREBASE_CREDENTIALS) 로 주입받기 위한 설정 - val firebaseCredentials: String? = - (project.findProperty("credentials") as String?) - ?: System.getenv("FIREBASE_CREDENTIALS") - - val credentials = firebaseCredentials - - if (!credentials.isNullOrBlank()) { - // CI/CD용 임시 파일 생성 (GitHub Secrets 등으로 전달된 JSON 문자열 사용) - val tempFile = - layout.buildDirectory.file("intermediates/firebase/serviceAccountKey.json") - .get().asFile - tempFile.parentFile.mkdirs() - tempFile.writeText(credentials) - - // Firebase에 전달 - serviceCredentialsFile = tempFile.absolutePath - } else { - println("Firebase App Distribution credentials not provided. Skipping serviceCredentialsFile configuration.") - } - - artifactType = "APK" - groups = "eat-ssu-android-qa" - releaseNotes = """ - Release 빌드 - 버전 ${defaultConfig.versionName} (${defaultConfig.versionCode}) - 프로덕션 테스트 빌드입니다. - """.trimIndent() - } } getByName("debug") { @@ -115,36 +84,6 @@ android { manifestPlaceholders["NAVER_MAPS_CLIENT_ID"] = naverMapsClientID isMinifyEnabled = false - - firebaseAppDistribution { - // Firebase App Distribution 서비스 계정 JSON을 -Pcredentials 또는 환경변수(FIREBASE_CREDENTIALS) 로 주입받기 위한 설정 - val firebaseCredentials: String? = - (project.findProperty("credentials") as String?) - ?: System.getenv("FIREBASE_CREDENTIALS") - - val credentials = firebaseCredentials - - if (!credentials.isNullOrBlank()) { - // CI/CD용 임시 파일 생성 (GitHub Secrets 등으로 전달된 JSON 문자열 사용) - val tempFile = - layout.buildDirectory.file("intermediates/firebase/serviceAccountKey_debug.json") - .get().asFile - tempFile.parentFile.mkdirs() - tempFile.writeText(credentials) - - // Firebase에 전달 - serviceCredentialsFile = tempFile.absolutePath - } else { - println("Firebase App Distribution credentials not provided for debug.") - } - - artifactType = "APK" - groups = "eat-ssu-android-qa" - releaseNotes = """ - Debug 빌드 - 버전 ${defaultConfig.versionName} (${defaultConfig.versionCode}) - 디버그 테스트 빌드입니다. - """.trimIndent() - } } } diff --git a/build.gradle.kts b/build.gradle.kts index 79583bb3b..b28a406f7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,6 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.google.services) apply false alias(libs.plugins.firebase.crashlytics) apply false - alias(libs.plugins.firebase.app.distribution) apply false alias(libs.plugins.hilt.android) apply false } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d1c28a7d0..2ea2e850a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -49,7 +49,6 @@ androidxHilt = "1.2.0" play-services-base = "18.0.1" firebase-bom = "32.6.0" firebase-crashlytics = "2.9.9" -firebase-app-distribution = "5.2.0" google-services = "4.4.2" timber = "5.0.1" kotlin-android = "1.9.25" @@ -163,4 +162,3 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-an google-services = { id = "com.google.gms.google-services", version.ref = "google-services" } firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebase-crashlytics" } hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } -firebase-app-distribution = { id = "com.google.firebase.appdistribution", version.ref = "firebase-app-distribution" } \ No newline at end of file