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
35 changes: 24 additions & 11 deletions .github/workflows/firebase-app-distribution.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: Firebase App Distribution

on:
push:
tags: [ "v*" ]
workflow_dispatch:
inputs:
tag_name:
description: Distribution tag to build from
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ inputs.tag_name || github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -21,6 +25,7 @@ jobs:
uses: actions/checkout@v5
with:
fetch-depth: 0
ref: ${{ inputs.tag_name }}

- name: Set up JDK 21
uses: actions/setup-java@v5
Expand All @@ -44,13 +49,21 @@ jobs:
${{ secrets.GOOGLE_SERVICES_JSON }}
EOF

- name: Create Android release keystore
run: |
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > ./prezel.jks

- name: Prepare version metadata
run: |
DISTRIBUTION_TAG="${{ inputs.tag_name }}"
echo "DISTRIBUTION_TAG=$DISTRIBUTION_TAG" >> "$GITHUB_ENV"
echo "ANDROID_VERSION_CODE=${GITHUB_RUN_NUMBER}" >> "$GITHUB_ENV"
echo "ANDROID_VERSION_NAME=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
echo "ANDROID_VERSION_NAME=${DISTRIBUTION_TAG#v}" >> "$GITHUB_ENV"
echo "APP_APPLICATION_ID=com.team.prezel.dev" >> "$GITHUB_ENV"
echo "APP_NAME=Prezel (Internal)" >> "$GITHUB_ENV"
Comment thread
moondev03 marked this conversation as resolved.

- name: Build Debug APK
run: ./gradlew assembleDebug --build-cache --parallel
- name: Build Release APK
run: ./gradlew assembleRelease --build-cache --parallel

- name: Upload to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
Expand All @@ -59,17 +72,17 @@ jobs:
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: ${{ vars.FIREBASE_APP_DISTRIBUTION_GROUPS }}
releaseNotes: |
Tag: ${{ github.ref_name }}
Tag: ${{ env.DISTRIBUTION_TAG }}
Commit: ${{ github.sha }}
Actor: ${{ github.actor }}
Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
file: ./Prezel/app/build/outputs/apk/debug/app-debug.apk
file: ./Prezel/app/build/outputs/apk/release/app-release.apk

- name: Send Discord Notification
if: always()
env:
DISCORD_WEBHOOK: ${{ secrets.DISTRIBUTION_DISCORD_HOOK_URL }}
STATUS_TITLE: ${{ job.status == 'success' && '✅ Firebase Debug 배포 성공' || '❌ Firebase Debug 배포 실패' }}
STATUS_TITLE: ${{ job.status == 'success' && '✅ Firebase Release 배포 성공' || '❌ Firebase Release 배포 실패' }}
STATUS_COLOR: ${{ job.status == 'success' && '3066993' || '15158332' }}
BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
EVENT_TIMESTAMP: ${{ github.event.head_commit.timestamp || github.event.repository.pushed_at }}
Expand All @@ -84,12 +97,12 @@ jobs:
"embeds": [
{
"title": "$STATUS_TITLE",
"description": "Firebase Distribution Debug APK 배포가 완료되었습니다.",
"description": "Firebase Distribution Release APK 배포가 완료되었습니다.",
"color": $STATUS_COLOR,
"fields": [
{
"name": "🏷 Tag",
"value": "${{ github.ref_name }}"
"value": "${{ env.DISTRIBUTION_TAG }}"
},
{
"name": "📦 Version",
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/version-tag-on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ on:
types: [ "closed" ]

permissions:
actions: write
contents: write

jobs:
tag-version:
if: ${{ github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop' }}
if: ${{ github.event_name == 'push' || (github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop') }}
runs-on: ubuntu-latest

steps:
Expand All @@ -21,8 +22,8 @@ jobs:

- name: Determine next version tag
env:
PR_LABELS_JSON: ${{ toJson(github.event.pull_request.labels.*.name) }}
TARGET_SHA: ${{ github.event.pull_request.merge_commit_sha }}
PR_LABELS_JSON: ${{ github.event_name == 'pull_request' && toJson(github.event.pull_request.labels.*.name) || '[]' }}
TARGET_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.merge_commit_sha || github.sha }}
run: |
set -euo pipefail

Expand Down Expand Up @@ -72,7 +73,7 @@ jobs:
- name: Create version tag
if: ${{ env.TAG_ALREADY_EXISTS == 'false' }}
env:
TARGET_SHA: ${{ github.event.pull_request.merge_commit_sha }}
TARGET_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.merge_commit_sha || github.sha }}
run: |
set -euo pipefail

Expand All @@ -81,3 +82,17 @@ jobs:

git tag -a "$TAG_NAME" "$TARGET_SHA" -m "Release $TAG_NAME"
git push origin "$TAG_NAME"

- name: Dispatch Firebase distribution workflow
uses: actions/github-script@v8
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "firebase-app-distribution.yml",
ref: context.ref.replace("refs/heads/", ""),
inputs: {
tag_name: process.env.TAG_NAME,
},
});
Comment thread
moondev03 marked this conversation as resolved.
3 changes: 2 additions & 1 deletion Prezel/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/captures
.externalNativeBuild
.cxx
local.properties
*.jks
*.keystore
.agents/
skills-lock.json
32 changes: 28 additions & 4 deletions Prezel/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties

plugins {
alias(libs.plugins.prezel.android.application.compose)
alias(libs.plugins.prezel.hilt)
Expand All @@ -13,15 +15,35 @@ val androidVersionNameProvider = providers
.gradleProperty("ANDROID_VERSION_NAME")
.orElse(providers.environmentVariable("ANDROID_VERSION_NAME"))
.orElse("0.1.0")
val appApplicationIdProvider = providers
.gradleProperty("APP_APPLICATION_ID")
.orElse(providers.environmentVariable("APP_APPLICATION_ID"))
.orElse("com.team.prezel")
val appNameProvider = providers
.gradleProperty("APP_NAME")
.orElse(providers.environmentVariable("APP_NAME"))
.orElse("Prezel")

android {
namespace = "com.team.prezel"

defaultConfig {
applicationId = appApplicationIdProvider.get()
versionCode = androidVersionCodeProvider.get().toInt()
versionName = androidVersionNameProvider.get()
}

signingConfigs {
create("release") {
val localProperties = gradleLocalProperties(rootDir, providers)

storeFile = rootProject.file(localProperties.getProperty("signed.store.file"))
storePassword = localProperties.getProperty("signed.store.password")
keyAlias = localProperties.getProperty("signed.key.alias")
keyPassword = localProperties.getProperty("signed.key.password")
}
}
Comment thread
moondev03 marked this conversation as resolved.

buildTypes {
debug {
isMinifyEnabled = false
Expand All @@ -30,8 +52,10 @@ android {
}

release {
isMinifyEnabled = true
isShrinkResources = true
isMinifyEnabled = false
isShrinkResources = false
resValue("string", "app_name", appNameProvider.get())
signingConfig = signingConfigs.getByName("release")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
Expand Down Expand Up @@ -61,10 +85,10 @@ dependencies {
implementation(projects.featureHomeImpl)
implementation(projects.featureHistoryApi)
implementation(projects.featureHistoryImpl)
implementation(projects.featureFeedbackApi)
implementation(projects.featureFeedbackImpl)
implementation(projects.featureMyApi)
implementation(projects.featureMyImpl)
implementation(projects.featureFeedbackApi)
implementation(projects.featureFeedbackImpl)

implementation(projects.featureTermsImpl)
implementation(projects.featurePracticeImpl)
Expand Down