Skip to content

Commit

Permalink
๐ŸŒŸ Firebase Distribution | CI/CD ๊ตฌ์ถ• (#15)
Browse files Browse the repository at this point in the history
* Create versioning-and-deployment.yml

* Update versioning-and-deployment.yml

* ๐Ÿ› ๏ธ CI/CD | signingConfig Setting

* ๐Ÿ› ๏ธ CI/CD | Add Properties

* ๐Ÿ› ๏ธ CI/CD | Modify OutputFileName

* ๐Ÿ› ๏ธ CI/CD | Modify OutputFileName

* ๐Ÿ› ๏ธ CI/CD | Modify OutputFile Path

* ๐Ÿ› ๏ธ CI/CD | Modify OutputFile Path

* Squashed commit of the following:

commit 7b7bbd7
Author: GyeongminKimGyeongminKim <[email protected]>
Date:   Wed Sep 4 12:24:39 2024 +0900

    ๐Ÿ“ ๊ธฐํš, ๋””์ž์ธ ์ˆ˜์ • ์‚ฌํ•ญ ๋ฐ˜์˜ (#14)

    * ๐Ÿ”จ๊ณต์ง€ ์•„์ดํ…œ ์ฆ๊ฒจ์ฐพ๊ธฐ ์œ„์น˜ ์ˆ˜์ •

    * ๐Ÿ”จ๋‚˜์˜ ๊ณต์ง€ ๋ฒ„ํŠผ ์‚ญ์ œ

    * ๐Ÿ”จ์ฆ๊ฒจ์ฐพ๊ธฐ ํ† ์ŠคํŠธ ๋ฉ”์‹œ์ง€ ๋ผ์ดํŒ… ์ˆ˜์ •

    * ๐Ÿ”จ์ฆ๊ฒจ์ฐพ๊ธฐ ํ† ์ŠคํŠธ ๋ฉ”์‹œ์ง€ ๋ผ์ดํŒ… ์ˆ˜์ •

    * ๐Ÿ”จ๋กœ๊ณ  ํด๋ฆญ ์‹œ ํ™ˆ ํ™”๋ฉด ์ด๋™ ๊ตฌํ˜„

* ๐Ÿ› ๏ธ CI/CD | Modify Trigger to Develop
  • Loading branch information
moondev03 authored Sep 4, 2024
1 parent 7b7bbd7 commit 61e1639
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 6 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/versioning-and-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Versioning, Build And Deployment to Firebase App Distribution
on:
push:
branches: [ develop ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
env:
LOCAL_PROPERTIES_CONTENTS: ${{ secrets.LOCAL_PROPERTIES_CONTENTS }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
VERSION_CODE: ${{ github.run_number }}
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Grant execute permission for gradlew
run: chmod +x ./ThinkerBell/gradlew

- name: Create google-services.json
run: echo "$GOOGLE_SERVICES_JSON" > ./ThinkerBell/presentation/google-services.json

- name: Create local.properties
run: echo "$LOCAL_PROPERTIES_CONTENTS" > ./ThinkerBell/local.properties

- name: Decode and save keystore
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > ./ThinkerBell/presentation/keystore.jks

- name: Verify keystore
run: |
ls -alh ./ThinkerBell/presentation/
echo "Checking JKS format..."
keytool -list -v -keystore ./ThinkerBell/presentation/keystore.jks -storetype JKS || echo "JKS format verification failed"
- name: Build release APK
run: |
cd ./ThinkerBell
./gradlew assembleRelease -PversionCode=$VERSION_CODE
- name: Upload to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: Team-NeverLand
file: ./ThinkerBell/presentation/build/outputs/apk/release/thinkerbell-release.apk
30 changes: 29 additions & 1 deletion ThinkerBell/presentation/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.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
Expand All @@ -7,6 +9,8 @@ plugins {
alias(libs.plugins.hilt)
}

val properties = gradleLocalProperties(rootDir, providers)

android {
namespace = "com.neverland.thinkerbell"
compileSdk = 34
Expand All @@ -16,13 +20,37 @@ android {
minSdk = 29
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

versionName = "0.0.1"
versionCode = if (project.hasProperty("versionCode")) {
project.property("versionCode").toString().toInt()
} else {
1
}
}

applicationVariants.all {
outputs.all {
val outputImpl = this as com.android.build.gradle.internal.api.ApkVariantOutputImpl
val newFileName = "thinkerbell-${name}.apk"
outputImpl.outputFileName = newFileName
}
}

signingConfigs {
create("release") {
keyAlias = properties["SIGNED_KEY_ALIAS"] as String?
keyPassword = properties["SIGNED_KEY_PASSWORD"] as String?
storeFile = properties["SIGNED_STORE_FILE"]?.let { file(it) }
storePassword = properties["SIGNED_STORE_PASSWORD"] as String?
}
}

buildTypes {
release {
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
android:layout_width="124dp"
android:layout_height="42dp"

app:layout_constraintTop_toBottomOf="@id/tv_dialog_contact_title"
app:layout_constraintTop_toBottomOf="@id/tv_dialog_title"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/btn_dialog_contact_call"
app:layout_constraintEnd_toStartOf="@id/btn_dialog_delete"
app:layout_constraintHorizontal_chainStyle="packed"
android:layout_marginEnd="8dp"

Expand All @@ -50,10 +50,10 @@
android:layout_width="124dp"
android:layout_height="42dp"

app:layout_constraintTop_toBottomOf="@id/tv_dialog_contact_title"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="@id/btn_dialog_cancel"
app:layout_constraintBottom_toBottomOf="@id/btn_dialog_cancel"
app:layout_constraintVertical_bias="1"
app:layout_constraintStart_toEndOf="@id/btn_dialog_contact_copy"
app:layout_constraintStart_toEndOf="@id/btn_dialog_cancel"
app:layout_constraintEnd_toEndOf="parent"

android:background="@drawable/shape_dialog_contact_btn_bg"
Expand Down

0 comments on commit 61e1639

Please sign in to comment.