Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -38,7 +46,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: |
Expand All @@ -56,5 +64,22 @@ jobs:

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build

- 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

60 changes: 60 additions & 0 deletions .github/workflows/qa_apk_firebase.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ lint/tmp/
.DS_Store
._.DS_Store
**/.DS_Store
**/._.DS_Store
**/._.DS_Store
5 changes: 3 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ android {
}

buildTypes {
release {
getByName("release") {
val p = Properties()
p.load(project.rootProject.file("local.properties").reader())

Expand All @@ -62,9 +62,10 @@ android {
isShrinkResources = true
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")

}

debug {
getByName("debug") {
applicationIdSuffix = ".debug"
// isDebuggable = false

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ 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" }
hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }