Skip to content

Firebase App Distribution 내부 배포 플로우 정비#146

Merged
moondev03 merged 11 commits into
developfrom
fix/firebase-distribution
Jun 1, 2026
Merged

Firebase App Distribution 내부 배포 플로우 정비#146
moondev03 merged 11 commits into
developfrom
fix/firebase-distribution

Conversation

@moondev03

@moondev03 moondev03 commented Jun 1, 2026

Copy link
Copy Markdown
Member

📌 작업 내용

  • Firebase App Distribution 워크플로우를 tag push 기반에서 workflow_dispatch 기반으로 변경했습니다.
  • 버전 태그 생성 후 Firebase 배포 워크플로우를 자동으로 호출하도록 연결했습니다.
  • 배포용 APK를 debug에서 release로 전환했습니다.
  • CI 환경에서 ANDROID_VERSION_NAME, APP_APPLICATION_ID, APP_NAME를 주입해 배포 빌드 메타데이터를 동적으로 설정하도록 변경했습니다.
  • 릴리스 서명 설정을 추가하고, keystore 파일을 CI에서 base64로 복원하도록 구성했습니다.

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 자동화된 빌드 및 배포 파이프라인 개선으로 릴리스 프로세스 효율화
    • 애플리케이션 키 관리 자동화 및 보안 설정 강화
    • 버전 태깅 및 자동 배포 워크플로우 최적화

moondev03 added 11 commits June 1, 2026 02:33
* **refactor: `firebase-app-distribution.yml` 트리거 및 빌드 로직 수정**
    * 워크플로우 트리거 방식을 기존 태그 푸시(`push: tags`)에서 수동 및 외부 호출(`workflow_dispatch`) 방식으로 변경했습니다.
    * `tag_name`을 입력 파라미터로 받아 특정 태그를 체크아웃하고 빌드하도록 수정했습니다.
    * 앱 버전명(`ANDROID_VERSION_NAME`)과 릴리스 노트의 태그 정보를 입력받은 `DISTRIBUTION_TAG` 기반으로 생성하도록 개선했습니다.

* **feat: `version-tag-on-merge.yml` 내 배포 자동화 로직 추가**
    * 태그 생성 완료 후 Firebase 배포 워크플로우를 자동으로 실행하는 디스패치(Dispatch) 단계를 추가했습니다.
    * 워크플로우 실행을 위해 `actions: write` 권한을 추가하고 `github-script`를 사용하여 `firebase-app-distribution.yml`을 호출합니다.
* **build: `app` 모듈 내 릴리스 서명(Signing Config) 구성**
    * `gradleLocalProperties`를 사용하여 `local.properties`에 정의된 키스토어 정보(파일 경로, 비밀번호, 별칭)를 불러오도록 설정했습니다.
    * `release` 빌드 타입에 릴리스 서명 설정을 적용했습니다.
    * `release` 빌드 타입에서 `isMinifyEnabled`와 `isShrinkResources`를 `false`로 변경했습니다.

* **ci: Firebase App Distribution 대상을 Debug에서 Release로 변경**
    * GitHub Actions 워크플로우 내 빌드 태스크를 `assembleDebug`에서 `assembleRelease`로 수정했습니다.
    * 빌드 전 GitHub Secrets의 `ANDROID_KEYSTORE_BASE64`를 디코딩하여 릴리스 키스토어 파일(`.jks`)을 생성하는 단계를 추가했습니다.
    * 배포 결과물 경로를 `app-release.apk`로 업데이트하고, Discord 알림 메시지의 문구를 배포 환경에 맞춰 수정했습니다.

* **chore: `.gitignore` 서명 관련 파일 제외 설정**
    * 키스토어 파일 유출 방지를 위해 `*.jks` 및 `*.keystore` 패턴을 `.gitignore`에 추가했습니다.
* **ci: Firebase App Distribution 워크플로우 내 키스토어 경로 변경**
    * 생성되는 키스토어 파일 이름을 `release-keystore.jks`에서 `keystore.jks`로 수정했습니다.
* **build: `build.gradle.kts` 내 앱 ID 및 이름 동적 주입 로직 구현**
    * Gradle 속성 또는 환경 변수(`APP_APPLICATION_ID`, `APP_NAME`)로부터 값을 주입받는 Provider를 추가했습니다.
    * 주입받은 값을 `defaultConfig`의 `applicationId`에 적용하고, `release` 빌드 타입에서 `app_name` 리소스 값을 동적으로 생성하도록 설정했습니다.
    * 환경 변수가 없을 경우 사용될 기본값(`com.team.prezel`, `Prezel`)을 정의했습니다.

* **ci: Firebase App Distribution 워크플로우 설정 업데이트**
    * 내부 테스트 배포용 앱 구분을 위해 `APP_APPLICATION_ID`를 `com.team.prezel.internal`로, `APP_NAME`을 `Prezel (Internal)`로 설정하는 환경 변수를 추가했습니다.
    * Android 릴리스 키스토어 생성 경로를 `./app/keystore.jks`에서 루트 디렉토리인 `./keystore.jks`로 변경했습니다.
* **build: Firebase App Distribution 워크플로우 내 Application ID 변경**
    * `APP_APPLICATION_ID` 환경 변수 값을 `com.team.prezel.internal`에서 `com.team.prezel.dev`로 수정했습니다.
* **build: Android 릴리스 키스토어 생성 파일명 수정**
    * GitHub Actions 워크플로우에서 디코딩된 키스토어 파일의 이름을 `keystore.jks`에서 `prezel.jks`로 변경했습니다.
* **ci: 불필요한 push 이벤트 트리거 제거**
    * `version-tag-on-merge.yml` 워크플로 구성에서 `fix/firebase-distribution` 브랜치에 설정되어 있던 `push` 트리거를 삭제했습니다.
# Conflicts:
#	.github/workflows/firebase-app-distribution.yml
#	.github/workflows/version-tag-on-merge.yml
#	Prezel/app/build.gradle.kts
@moondev03 moondev03 self-assigned this Jun 1, 2026
@moondev03 moondev03 added the 🔧 fix 정상 동작해야 하는 기능의 결함 수정 label Jun 1, 2026
@moondev03 moondev03 requested a review from HamBeomJoon as a code owner June 1, 2026 04:11
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

GitHub Actions workflows are restructured to automate Android release distribution: version tagging workflow gains permissions and logic to dispatch Firebase distribution workflow with generated tags; Firebase workflow converts from automatic tag-based to manual dispatch triggering, and Gradle build configuration is updated to support dynamic application metadata and release signing.

Changes

Release Distribution Pipeline Automation

Layer / File(s) Summary
Release distribution workflow orchestration
.github/workflows/version-tag-on-merge.yml
Permissions added for workflow dispatch; job condition extended to support both push and PR-based triggers; environment variables branch on event type; new step dispatches firebase-app-distribution workflow with generated tag name.
Firebase distribution workflow dispatch conversion
.github/workflows/firebase-app-distribution.yml (lines 4–28)
Workflow trigger changes from push-with-tag-filter to workflow_dispatch; accepts tag_name input; concurrency group and checkout ref derive from input.
Firebase release build and distribution
.github/workflows/firebase-app-distribution.yml (lines 52–105)
Keystore decoded from BASE64 environment variable; version metadata and app identifiers extracted from tag input; build switched from Debug to Release; Firebase upload and Discord notifications updated to use DISTRIBUTION_TAG for metadata.
Android build configuration for releases
Prezel/app/build.gradle.kts, Prezel/.gitignore
Gradle imports local properties helper; providers added for application ID and app name from environment variables; release signing configured from local properties; minification disabled; release build type applies dynamic app name; keystore file patterns added to gitignore.

Possibly related PRs

  • Team-Prezel/Prezel-Android#145: Modifies the same Firebase and version tagging workflows to implement tag-based release distribution triggering with dispatch and metadata updates.

Suggested labels

🧹 chore

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 PR의 주요 변경 사항인 Firebase App Distribution 워크플로우 정리를 명확하게 요약하고 있습니다.
Description check ✅ Passed PR 설명이 요구되는 템플릿의 '📌 작업 내용' 섹션을 포함하여 주요 변경 사항을 상세히 나열하고 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (4)
.github/workflows/version-tag-on-merge.yml (2)

87-87: 💤 Low value

Action 참조 핀 고정 권장.

actions/github-script@v8 대신 커밋 해시를 사용하면 supply-chain 공격 위험을 줄일 수 있습니다. (예: actions/github-script@60a0d83...)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/version-tag-on-merge.yml at line 87, Replace the floating
tag for the GitHub Action usage to pin to a specific commit SHA instead of the
major tag; locate the line containing "uses: actions/github-script@v8" and
change it to the action pinned by its commit (e.g., "uses:
actions/github-script@<commit-sha>") so the workflow references an exact commit
hash to reduce supply-chain risk.

14-14: 💤 Low value

push 이벤트 조건이 현재 트리거와 불일치합니다.

on: 섹션에 pull_request 트리거만 정의되어 있어 github.event_name == 'push'는 항상 false입니다. 향후 push 트리거 추가를 대비한 것이라면 주석을 남기거나, 불필요한 조건이라면 제거하는 것이 좋습니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/version-tag-on-merge.yml at line 14, The conditional in
the workflow's if expression uses github.event_name == 'push' even though the
workflow only declares a pull_request trigger; update the if expression to
remove the unused push check or add a comment explaining future intent.
Specifically edit the line containing "if: ${{ github.event_name == 'push' ||
(github.event.pull_request.merged == true && github.event.pull_request.base.ref
== 'develop') }}" to either (a) drop "github.event_name == 'push' ||" so the
condition relies solely on the pull_request merged check, or (b) keep it but add
a clarifying comment above that the push clause is intentional for future
push-trigger support; ensure the final condition correctly matches the declared
triggers.
.github/workflows/firebase-app-distribution.yml (1)

52-54: 💤 Low value

Keystore 파일 정리 고려.

워크플로우 실패 시 keystore 파일이 workflow artifact에 포함될 수 있습니다. 빌드 완료 후 rm ./prezel.jks로 정리하거나, if: always() 스텝을 추가하는 것을 권장합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/firebase-app-distribution.yml around lines 52 - 54, The
workflow step "Create Android release keystore" writes the decoded keystore to
./prezel.jks but never removes it, so failed or subsequent runs may leave the
keystore in artifacts; update the job to delete ./prezel.jks after the build
(e.g., run rm ./prezel.jks) or add a separate cleanup step with if: always()
that removes ./prezel.jks to ensure the keystore is not persisted in workflow
artifacts.
Prezel/app/build.gradle.kts (1)

55-56: 💤 Low value

Release 빌드에서 minification/shrinking 비활성화 의도 확인.

내부 배포용이라면 괜찮지만, 향후 프로덕션 배포 시에는 isMinifyEnabled = trueisShrinkResources = true가 APK 크기 최적화 및 난독화에 필요합니다. 주석으로 의도를 명시하는 것을 권장합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Prezel/app/build.gradle.kts` around lines 55 - 56, The Release build
currently has isMinifyEnabled = false and isShrinkResources = false which
disables code shrinking/obfuscation; either enable them for production by
setting isMinifyEnabled = true and isShrinkResources = true in the release block
and ensure proguard/R8 rules (e.g., consumerProguardFiles or proguard-rules.pro)
are configured, or if this is intentional for internal distribution add a clear
comment above the release configuration explaining the intent and that these
flags should be switched to true before production release; locate the release
buildType settings where isMinifyEnabled and isShrinkResources are defined to
apply the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/firebase-app-distribution.yml:
- Around line 56-63: Validate and sanitize inputs.tag_name before using it in
the "Prepare version metadata" step: check that DISTRIBUTION_TAG (from
inputs.tag_name) matches a strict semver tag regex like
^v[0-9]+\.[0-9]+\.[0-9]+$ and if it doesn't, fail the job (exit non-zero) or set
a safe fallback; only then export ANDROID_VERSION_NAME=${DISTRIBUTION_TAG#v} and
other env vars. Implement this validation in the same step (before echoing to
$GITHUB_ENV) so functions/variables DISTRIBUTION_TAG and ANDROID_VERSION_NAME
are only derived from a validated, sanitized inputs.tag_name to prevent command
injection.

In @.github/workflows/version-tag-on-merge.yml:
- Around line 86-98: The ref passed to
github.rest.actions.createWorkflowDispatch is derived from
context.ref.replace("refs/heads/", "") which is invalid for pull_request events
(context.ref is refs/pull/.../merge); update the createWorkflowDispatch call to
use a correct ref: prefer the created tag (process.env.TAG_NAME) when available,
otherwise fall back to the PR base branch (github.event.pull_request.base.ref)
or a fixed branch like "develop" — replace the current
context.ref.replace("refs/heads/", "") usage in the createWorkflowDispatch
payload with logic that selects process.env.TAG_NAME ||
github.event.pull_request.base.ref || "develop".

In `@Prezel/app/build.gradle.kts`:
- Around line 36-45: The signing config creation uses nullable properties from
gradleLocalProperties which can be null and cause build failures; update the
signingConfigs.create("release") block to first check that localProperties
contains non-null values for "signed.store.file", "signed.store.password",
"signed.key.alias", and "signed.key.password" and only set
storeFile/storePassword/keyAlias/keyPassword when all values are present
(otherwise skip creating/setting the release signingConfig), and in the
buildTypes.release block assign signingConfig =
signingConfigs.findByName("release") so the release build only uses the signing
config when it exists; reference the signingConfigs.create("release") block and
the release buildType signingConfig assignment to locate and change the code.

---

Nitpick comments:
In @.github/workflows/firebase-app-distribution.yml:
- Around line 52-54: The workflow step "Create Android release keystore" writes
the decoded keystore to ./prezel.jks but never removes it, so failed or
subsequent runs may leave the keystore in artifacts; update the job to delete
./prezel.jks after the build (e.g., run rm ./prezel.jks) or add a separate
cleanup step with if: always() that removes ./prezel.jks to ensure the keystore
is not persisted in workflow artifacts.

In @.github/workflows/version-tag-on-merge.yml:
- Line 87: Replace the floating tag for the GitHub Action usage to pin to a
specific commit SHA instead of the major tag; locate the line containing "uses:
actions/github-script@v8" and change it to the action pinned by its commit
(e.g., "uses: actions/github-script@<commit-sha>") so the workflow references an
exact commit hash to reduce supply-chain risk.
- Line 14: The conditional in the workflow's if expression uses
github.event_name == 'push' even though the workflow only declares a
pull_request trigger; update the if expression to remove the unused push check
or add a comment explaining future intent. Specifically edit the line containing
"if: ${{ github.event_name == 'push' || (github.event.pull_request.merged ==
true && github.event.pull_request.base.ref == 'develop') }}" to either (a) drop
"github.event_name == 'push' ||" so the condition relies solely on the
pull_request merged check, or (b) keep it but add a clarifying comment above
that the push clause is intentional for future push-trigger support; ensure the
final condition correctly matches the declared triggers.

In `@Prezel/app/build.gradle.kts`:
- Around line 55-56: The Release build currently has isMinifyEnabled = false and
isShrinkResources = false which disables code shrinking/obfuscation; either
enable them for production by setting isMinifyEnabled = true and
isShrinkResources = true in the release block and ensure proguard/R8 rules
(e.g., consumerProguardFiles or proguard-rules.pro) are configured, or if this
is intentional for internal distribution add a clear comment above the release
configuration explaining the intent and that these flags should be switched to
true before production release; locate the release buildType settings where
isMinifyEnabled and isShrinkResources are defined to apply the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6b822d2f-fc84-416e-9ace-fcaf4d1be182

📥 Commits

Reviewing files that changed from the base of the PR and between 50e7e20 and 415ef36.

📒 Files selected for processing (4)
  • .github/workflows/firebase-app-distribution.yml
  • .github/workflows/version-tag-on-merge.yml
  • Prezel/.gitignore
  • Prezel/app/build.gradle.kts

Comment thread .github/workflows/firebase-app-distribution.yml
Comment thread .github/workflows/version-tag-on-merge.yml
Comment thread Prezel/app/build.gradle.kts
@moondev03 moondev03 merged commit def0c70 into develop Jun 1, 2026
3 checks passed
@moondev03 moondev03 deleted the fix/firebase-distribution branch June 1, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 fix 정상 동작해야 하는 기능의 결함 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants