Skip to content
Merged
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
127 changes: 0 additions & 127 deletions .coderabbit.yaml

This file was deleted.

32 changes: 15 additions & 17 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@ name: Android CI

on:
pull_request:
# 'main' 또는 'android' 브랜치로 PR이 병합될 때 트리거
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

android가 아니라 dev 브랜치 말씀하시는거겠죠?!

branches:
- main
- develop
# 'android' 디렉토리 내의 파일이 변경되었을 때만 워크플로우를 실행
path:
- '/**'

jobs:
Run-PR-Test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: android

permissions:
contents: write
checks: write

steps:
- name: Repository Checkout
Expand All @@ -34,7 +31,7 @@ jobs:
~/.gradle/caches
~/.gradle/wrapper
~/.android/build-cache
key: ${{ runner.os }}-gradle-${{ hashFiles('android/**/build.gradle.kts', 'android/**/settings.gradle.kts', 'android/**/gradle-wrapper.properties', 'android/gradle/libs.versions.toml', 'android/**/gradle.properties') }}
key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle.kts', '**/settings.gradle.kts', '**/gradle-wrapper.properties', 'gradle/libs.versions.toml', '**/gradle.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

Expand All @@ -52,8 +49,7 @@ jobs:

- name: Restore keystore file
run: |
mkdir -p app
echo "$KEYSTORE_BASE64" | base64 --decode > ./app/festabook_appkey.jks
echo "$KEYSTORE_BASE64" | base64 --decode > app/festabook_appkey.jks
echo "JKS_FILE_PATH=./app/festabook_appkey.jks" >> local.properties
echo "STORE_PASSWORD=${{ secrets.STORE_PASSWORD }}" >> local.properties
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> local.properties
Expand All @@ -62,20 +58,22 @@ jobs:
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}

- name: Clean Project
run: ./gradlew clean

- name: Run ktlint
run: ./gradlew ktlintCheck

- name: Run Unit Test
run: ./gradlew test

- name: Run Debug Unit Test (for Develop PRs)
if: github.base_ref == 'develop'
run: ./gradlew testDebugUnitTest

- name: Run Release Unit Test (for Main PRs)
if: github.base_ref == 'main'
run: ./gradlew testReleaseUnitTest

- name: Publish Unit Test Results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: android/app/build/test-results/**/TEST-*.xml
files: app/build/test-results/**/TEST-*.xml
check_name: '테스트 결과 🛠️'
check_run_annotations: 'none'
comment_mode: 'off'
121 changes: 121 additions & 0 deletions .github/workflows/android-release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Android CD

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
Upload-Release-Bundle:
runs-on: ubuntu-latest
outputs:
version_code: ${{ steps.get_version.outputs.version_code }}

steps:
- name: Repository Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.android/build-cache
key: ${{ runner.os }}-gradle-${{ hashFiles('android/**/build.gradle.kts', 'android/**/settings.gradle.kts', 'android/**/gradle-wrapper.properties', 'android/gradle/libs.versions.toml', 'android/**/gradle.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Create local.properties with BASE_URL
run: |
echo BASE_URL=\"${{ secrets.BASE_URL }}\" > local.properties
echo BASE_URL_DEV=\"${{ secrets.BASE_URL_DEV }}\" >> local.properties
echo NAVER_MAP_CLIENT_ID=\"${{ secrets.NAVER_MAP_CLIENT_ID }}\" >> local.properties
echo NAVER_MAP_STYLE_ID=\"${{ secrets.NAVER_MAP_STYLE_ID }}\" >> local.properties

- name: Load Google Service file
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo "$DATA" > app/google-services.json

- name: Restore keystore file
run: |
echo "$KEYSTORE_BASE64" | base64 --decode > app/festabook_appkey.jks
echo "JKS_FILE_PATH=./festabook_appkey.jks" >> local.properties
echo "STORE_PASSWORD=${{ secrets.STORE_PASSWORD }}" >> local.properties
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> local.properties
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> local.properties

env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}

- name: Build Release AAB
run: ./gradlew app:bundleRelease

#versionName의 숫자만 추출합니다 ex) versionName = "v1.2.1" -> 1.2.1
- name: Extract Version Code
id: get_version
run: |
VERSION_NAME=$(grep -oP 'versionName = "\K[^"]+' app/build.gradle.kts | head -1 | sed 's/[v ]//g')
echo "version_code=$VERSION_NAME" >> $GITHUB_OUTPUT
echo "Extracted Version: $VERSION_NAME"

- name: Upload Release Artifact
uses: actions/upload-artifact@v4
with:
name: app-release-bundle-${{ steps.get_version.outputs.version_code }}
path: app/build/outputs/bundle/release/app-release.aab
retention-days: 7

#번들이 업로드가 완료된 후 버전 태그를 작성합니다
Release-Drafter:
runs-on: ubuntu-latest
needs: Upload-Release-Bundle

steps:
- name: Repository Checkout
uses: actions/checkout@v4

#추출한 버전을 drafter에 적용합니다
- name: Update Draft Release
uses: release-drafter/release-drafter@v6
with:
version: ${{ needs.Upload-Release-Bundle.outputs.version_code }}
config-name: template/release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# hotfix 머지 시, main의 변경사항을 develop에 자동 반영합니다
# 번들이 업로드가 완료된 후 실행됩니다
Reflect-Changes-Into-Develop:
runs-on: ubuntu-latest
needs: Upload-Release-Bundle

steps:
- name: Develop Branch Checkout
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git User
run: |
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"

- name: Merge Main into Develop
run: |
git fetch origin main
git merge origin/main
git push origin develop
36 changes: 0 additions & 36 deletions .github/workflows/release-drafter.yml

This file was deleted.

1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.serialization)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.ktlint)
id("kotlin-kapt")
id("kotlin-parcelize")
id("com.google.gms.google-services")
Expand Down
Loading