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
107 changes: 107 additions & 0 deletions .github/workflows/android-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Android CD

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false"
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true

on:
pull_request:
branches:
- main

jobs:
cd-build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
# 최근 태그를 확인하기 위해 필요
fetch-depth: 0

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

- name: Generate reed.jks
run: echo '${{ secrets.REED_JAVA_KEYSTORE }}' | base64 -d > ./reed.jks

- name: Generate local.properties
run: echo '${{ secrets.LOCAL_PROPERTIES }}' | base64 -d > ./local.properties

- name: Generate keystore.properties
run: echo '${{ secrets.KEYSTORE_PROPERTIES }}' | base64 -d > ./keystore.properties

- name: Generate google-services.json
run: echo '${{ secrets.GOOGLE_SERVICES }}' | base64 -d > ./app/google-services.json

- name: Extract Version Name from ApplicationConstants.kt
run: |
set -euo pipefail
VERSION=$(grep "VERSION_NAME" build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt | sed -E 's/.*VERSION_NAME\s*=\s*"([^"]+)".*/\1/')
if [[ -z "$VERSION" ]]; then
echo "Error: ApplicationConstants.kt에서 VERSION_NAME 값을 추출하지 못했습니다." >&2
exit 1
fi
echo "version=v${VERSION}" >> "$GITHUB_OUTPUT"
echo "Version extracted from ApplicationConstants.kt: v${VERSION}"
id: extract_version

- name: Generate Firebase Release Note
id: firebase_release_note
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
# PR_TITLE은 env에서 안전하게 전달됨
# 가장 최근 태그 찾기 (현재 버전 이전의 태그)
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")

# 릴리스 노트 내용 생성
NOTES="## 🚀 변경사항: ${PR_TITLE}\n\n"

if [ -n "$LATEST_TAG" ]; then
NOTES="${NOTES}### 이전 버전($LATEST_TAG)부터의 변경사항:\n"
# 최근 태그부터 현재까지의 커밋만 가져옴
COMMITS=$(git log --pretty=format:"- %h %s (%an)" ${LATEST_TAG}..HEAD --no-merges)
NOTES="${NOTES}${COMMITS}"
else
NOTES="${NOTES}### 커밋 내역:\n"
# 태그가 없는 경우 최근 10개 커밋만 표시
COMMITS=$(git log --pretty=format:"- %h %s (%an)" --no-merges -n 10)
NOTES="${NOTES}${COMMITS}\n\n(이전 릴리스 태그가 없어 최근 10개 커밋만 표시)"
fi

# 환경 변수로 저장
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo -e "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

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

- name: Upload Release Build to Artifacts
uses: actions/upload-artifact@v4
with:
name: release-artifacts
path: app/build/outputs/bundle/release/
if-no-files-found: error

- name: Create Github Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.extract_version.outputs.version }}
release_name: ${{ steps.extract_version.outputs.version }}
generate_release_notes: true

Comment on lines +94 to +99
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

release_name 입력 파라미터는 v2에서 지원되지 않습니다

softprops/action-gh-release@v2에서는 release_name 대신 name 입력을 사용합니다. 그대로 두면 워크플로가 “input not defined” 오류로 실패합니다.

-                    release_name: ${{ steps.extract_version.outputs.version }}
+                    name: ${{ steps.extract_version.outputs.version }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.extract_version.outputs.version }}
release_name: ${{ steps.extract_version.outputs.version }}
generate_release_notes: true
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.extract_version.outputs.version }}
name: ${{ steps.extract_version.outputs.version }}
generate_release_notes: true
🧰 Tools
🪛 actionlint (1.7.7)

97-97: input "release_name" is not defined in action "softprops/action-gh-release@v2". available inputs are "append_body", "body", "body_path", "discussion_category_name", "draft", "fail_on_unmatched_files", "files", "generate_release_notes", "make_latest", "name", "prerelease", "preserve_order", "repository", "tag_name", "target_commitish", "token"

(action)

🤖 Prompt for AI Agents
In .github/workflows/android-cd.yml around lines 94 to 99, the release_name
input parameter is not supported by softprops/action-gh-release@v2 and causes an
"input not defined" error. Replace the release_name parameter with name, keeping
the same value from steps.extract_version.outputs.version to fix the workflow
failure.

- name: Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_RELEASE_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: testers
file: app/build/outputs/bundle/release/app-release.aab
releaseNotes: ${{ steps.firebase_release_note.outputs.notes }}
6 changes: 2 additions & 4 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ jobs:
gradle-home-cache-cleanup: true

- name: Generate local.properties
run: |
echo '${{ secrets.LOCAL_PROPERTIES }}' >> ./local.properties
run: echo '${{ secrets.LOCAL_PROPERTIES }}' | base64 -d > ./local.properties

- name: Generate keystore.properties
run: |
echo '${{ secrets.KEYSTORE_PROPERTIES }}' >> ./keystore.properties
run: echo '${{ secrets.KEYSTORE_PROPERTIES }}' | base64 -d > ./keystore.properties

- name: Generate google-services.json
run: echo '${{ secrets.GOOGLE_SERVICES }}' | base64 -d > ./app/google-services.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ internal class AndroidRetrofitConventionPlugin : Plugin<Project> {
"booket.kotlin.library.serialization",
)

extensions.configure<LibraryExtension> {
configureAndroid(this)

defaultConfig.apply {
targetSdk = ApplicationConstants.TARGET_SDK
}
}

dependencies {
implementation(libs.retrofit)
implementation(libs.retrofit.kotlinx.serialization.converter)
Expand Down
Loading