From 961831202ad07121f83619d52e3e2c371062be8d Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Sat, 23 Aug 2025 02:35:44 +0300 Subject: [PATCH 01/30] feat: add Firebase App Distribution and Google Services plugins --- build.gradle.kts | 2 ++ composeApp/build.gradle.kts | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index bca0fd741..42edf75c2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,8 @@ plugins { alias(libs.plugins.composeMultiplatform) apply false alias(libs.plugins.composeCompiler) apply false alias(libs.plugins.kotlinMultiplatform) apply false + alias(libs.plugins.googleFirebaseAppdistribution) apply false + alias(libs.plugins.googleGmsGoogleServices) apply false } repositories { diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index b00c82981..1cdcd0449 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -1,5 +1,8 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import java.io.FileInputStream +import java.util.Properties +import kotlin.apply plugins { alias(libs.plugins.kotlinMultiplatform) @@ -7,6 +10,8 @@ plugins { alias(libs.plugins.composeMultiplatform) alias(libs.plugins.composeCompiler) kotlin("plugin.serialization") version libs.versions.kotlin + alias(libs.plugins.googleFirebaseAppdistribution) + alias(libs.plugins.googleGmsGoogleServices) } kotlin { @@ -107,6 +112,21 @@ android { versionCode = 1 versionName = "1.0" } + val localFile = file("${rootProject.projectDir}/local.properties") + val locals = Properties().apply { + if (localFile.exists()) { + load(FileInputStream(localFile)) + } + } + + signingConfigs { + create("release") { + storeFile = file("JKS") + storePassword = locals.getProperty("KEYSTORE_PASSWORD") + keyAlias = locals.getProperty("KEY_ALIAS") + keyPassword = locals.getProperty("KEY_PASSWORD") + } + } packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" From 194d5e7459f7139f562e5218619c1439a48421d0 Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Sat, 23 Aug 2025 02:36:01 +0300 Subject: [PATCH 02/30] feat: implement Firebase App Distribution CD pipeline --- .github/workflows/cd-firebase.yml | 91 +++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/cd-firebase.yml diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml new file mode 100644 index 000000000..4f749bd44 --- /dev/null +++ b/.github/workflows/cd-firebase.yml @@ -0,0 +1,91 @@ +name: EvolveFit CD Pipeline + +on: + push: + branches: + - develop + - master + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '21' + + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + gradle-${{ runner.os }}- + + - name: Make gradlew executable + run: chmod +x ./gradlew + + - name: Create google-services.json + env: + GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} + run: | + mkdir -p app/ # Ensure the directory exists + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json + shell: bash + + - name: Decode Keystore and Create local.properties + env: + KEYSTORE: ${{ secrets.KEYSTORE }} + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + + run: | + rm -f app/JKS.jks local.properties release_notes.txt + echo "$KEYSTORE" | base64 -d > app/JKS.jks + echo "KEYSTORE_PASSWORD = $KEYSTORE_PASSWORD" >> local.properties + echo "KEY_ALIAS = $KEY_ALIAS" >> local.properties + echo "KEY_PASSWORD = $KEY_PASSWORD" >> local.properties + + - name: Generate Signed APK + env: + KEYSTORE: ${{ secrets.KEYSTORE }} + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + + run: | + ./gradlew assembleRelease --build-cache -x test -x lint + ls -l app/build/outputs/apk/release/app-release.apk || { echo "apk not generated"; exit 1; } + + - name: Extract Release Notes + id: release_notes + run: | + COMMIT_MSG=$(git log -1 --pretty=%B | sed 's/"/\\"/g' | tr -d '\n') + TRUNCATED_MSG="${COMMIT_MSG:0:500}" + echo "$TRUNCATED_MSG" > release_notes.txt + echo "notes=$TRUNCATED_MSG" >> $GITHUB_OUTPUT + echo "Release notes: $TRUNCATED_MSG" + + - name: Upload APKs to Firebase App Distribution + env: + FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} + FIREBASE_AUTH_TOKEN: ${{ secrets.FIREBASE_AUTH_TOKEN }} + run: | + npm install -g firebase-tools + firebase appdistribution:distribute \ + app/build/outputs/apk/release/app-release.apk \ + --app "$FIREBASE_APP_ID" \ + --token "$FIREBASE_AUTH_TOKEN" \ + --groups "cairo_squad" \ + --release-notes-file release_notes.txt From b4c9103651e0d6fee43ea7e607c279eb7087c4e4 Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Sat, 23 Aug 2025 02:36:33 +0300 Subject: [PATCH 03/30] feat: add Firebase App Distribution and Google Services plugins --- gradle/libs.versions.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 541977fb4..e5ae41a92 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -25,6 +25,8 @@ lifecycleViewModel = "2.9.1" filekit = "0.10.0" ktor = "3.2.3" core-splashscreen = "1.0.1" +googleFirebaseAppdistribution = "5.1.1" +googleGmsGoogleServices = "4.4.3" [libraries] compose-shadow = { module = "com.adamglin:compose-shadow", version.ref = "composeShadow" } @@ -79,6 +81,8 @@ androidLibrary = { id = "com.android.library", version.ref = "agp" } composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" } composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +googleFirebaseAppdistribution = { id = "com.google.firebase.appdistribution", version.ref = "googleFirebaseAppdistribution" } +googleGmsGoogleServices = { id = "com.google.gms.google-services", version.ref = "googleGmsGoogleServices" } [bundles] ktor = [ From 7f9da7d3450925bf24d005791e2b2f2f604c3c51 Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Sat, 23 Aug 2025 03:06:51 +0300 Subject: [PATCH 04/30] chore: update path for google-services.json in Firebase CD workflow --- .github/workflows/cd-firebase.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 4f749bd44..8318ca937 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -39,8 +39,8 @@ jobs: env: GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} run: | - mkdir -p app/ # Ensure the directory exists - echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json + mkdir -p composeApp/ # Ensure the directory exists + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json shell: bash - name: Decode Keystore and Create local.properties From 552cbdc5e7b0a63d09b42ee17687d4ebbaef1f5b Mon Sep 17 00:00:00 2001 From: Elsayed Magdy <161933600+ElsayedMagdy122@users.noreply.github.com> Date: Sat, 23 Aug 2025 03:12:13 +0300 Subject: [PATCH 05/30] Update android-ci.yml --- .github/workflows/android-ci.yml | 96 ++++++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 23 deletions(-) diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml index 8405c4849..8318ca937 100644 --- a/.github/workflows/android-ci.yml +++ b/.github/workflows/android-ci.yml @@ -1,41 +1,91 @@ -name: Android CI +name: EvolveFit CD Pipeline on: push: branches: - - main - develop - pull_request: - workflow_dispatch: -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - JAVA_VERSION: 21 + - master jobs: - android-build: - name: Android Build + deploy: runs-on: ubuntu-latest - timeout-minutes: 30 steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Setup Java + - name: Set up JDK uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: ${{ env.JAVA_VERSION }} - - - name: Build Android App - run: ./gradlew :composeApp:assembleDebug + java-version: '21' - - name: Upload Android APK - if: github.event_name == 'push' - uses: actions/upload-artifact@v4 + - name: Cache Gradle + uses: actions/cache@v4 with: - name: android-apk-debug - path: composeApp/build/outputs/apk/debug/*.apk \ No newline at end of file + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + gradle-${{ runner.os }}- + + - name: Make gradlew executable + run: chmod +x ./gradlew + + - name: Create google-services.json + env: + GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} + run: | + mkdir -p composeApp/ # Ensure the directory exists + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json + shell: bash + + - name: Decode Keystore and Create local.properties + env: + KEYSTORE: ${{ secrets.KEYSTORE }} + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + + run: | + rm -f app/JKS.jks local.properties release_notes.txt + echo "$KEYSTORE" | base64 -d > app/JKS.jks + echo "KEYSTORE_PASSWORD = $KEYSTORE_PASSWORD" >> local.properties + echo "KEY_ALIAS = $KEY_ALIAS" >> local.properties + echo "KEY_PASSWORD = $KEY_PASSWORD" >> local.properties + + - name: Generate Signed APK + env: + KEYSTORE: ${{ secrets.KEYSTORE }} + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + + run: | + ./gradlew assembleRelease --build-cache -x test -x lint + ls -l app/build/outputs/apk/release/app-release.apk || { echo "apk not generated"; exit 1; } + + - name: Extract Release Notes + id: release_notes + run: | + COMMIT_MSG=$(git log -1 --pretty=%B | sed 's/"/\\"/g' | tr -d '\n') + TRUNCATED_MSG="${COMMIT_MSG:0:500}" + echo "$TRUNCATED_MSG" > release_notes.txt + echo "notes=$TRUNCATED_MSG" >> $GITHUB_OUTPUT + echo "Release notes: $TRUNCATED_MSG" + + - name: Upload APKs to Firebase App Distribution + env: + FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} + FIREBASE_AUTH_TOKEN: ${{ secrets.FIREBASE_AUTH_TOKEN }} + run: | + npm install -g firebase-tools + firebase appdistribution:distribute \ + app/build/outputs/apk/release/app-release.apk \ + --app "$FIREBASE_APP_ID" \ + --token "$FIREBASE_AUTH_TOKEN" \ + --groups "cairo_squad" \ + --release-notes-file release_notes.txt From fc02c19323d69cb1c5dc6f418c96bbfe04e1a10c Mon Sep 17 00:00:00 2001 From: Elsayed Magdy <161933600+ElsayedMagdy122@users.noreply.github.com> Date: Sat, 23 Aug 2025 03:14:20 +0300 Subject: [PATCH 06/30] Update android-ci.yml From 29d314942e23f0d57cb02ccdd0e59426206c0638 Mon Sep 17 00:00:00 2001 From: Al-Qassim <71926296+Al-Qassim@users.noreply.github.com> Date: Sat, 23 Aug 2025 16:16:29 +0300 Subject: [PATCH 07/30] test cd fire base --- .github/workflows/cd-firebase.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 4f749bd44..b04e34e80 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -5,6 +5,7 @@ on: branches: - develop - master + - feature/cd-firebase jobs: deploy: From bd0fac1cd5be15e58ae60a92f4bec031f43c1050 Mon Sep 17 00:00:00 2001 From: Al-Qassim <71926296+Al-Qassim@users.noreply.github.com> Date: Sat, 23 Aug 2025 16:29:53 +0300 Subject: [PATCH 08/30] put json in right place --- .github/workflows/cd-firebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index b04e34e80..e27f137aa 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -41,7 +41,7 @@ jobs: GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} run: | mkdir -p app/ # Ensure the directory exists - echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > google-services.json shell: bash - name: Decode Keystore and Create local.properties From 7ad3836be7f77b10bfbd978e9a491989af1c7024 Mon Sep 17 00:00:00 2001 From: Al-Qassim <71926296+Al-Qassim@users.noreply.github.com> Date: Sat, 23 Aug 2025 16:48:07 +0300 Subject: [PATCH 09/30] 3rd try --- .github/workflows/cd-firebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index e27f137aa..aa65ebc95 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -41,7 +41,7 @@ jobs: GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} run: | mkdir -p app/ # Ensure the directory exists - echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > google-services.json + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > ./composeApp/src/release/google-services.json shell: bash - name: Decode Keystore and Create local.properties From bddd699224c8cd7ad31c314a36bb838d55310edf Mon Sep 17 00:00:00 2001 From: Al-Qassim <71926296+Al-Qassim@users.noreply.github.com> Date: Sat, 23 Aug 2025 16:49:13 +0300 Subject: [PATCH 10/30] 4th try --- .github/workflows/cd-firebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index aa65ebc95..22e9b1ae5 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -41,7 +41,7 @@ jobs: GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} run: | mkdir -p app/ # Ensure the directory exists - echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > ./composeApp/src/release/google-services.json + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/src/release/google-services.json shell: bash - name: Decode Keystore and Create local.properties From 42f1042c707a4c0318ff93ec44a4b01e6fc129e8 Mon Sep 17 00:00:00 2001 From: Al-Qassim <71926296+Al-Qassim@users.noreply.github.com> Date: Sat, 23 Aug 2025 16:50:42 +0300 Subject: [PATCH 11/30] 5th try --- .github/workflows/cd-firebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 22e9b1ae5..fc810ae0a 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -40,7 +40,7 @@ jobs: env: GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} run: | - mkdir -p app/ # Ensure the directory exists + mkdir -p composeApp/src/release/ # Ensure the directory exists echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/src/release/google-services.json shell: bash From 45f33aa8ada72530c087a00b637ead60b8e64e90 Mon Sep 17 00:00:00 2001 From: Al-Qassim <71926296+Al-Qassim@users.noreply.github.com> Date: Sat, 23 Aug 2025 16:51:58 +0300 Subject: [PATCH 12/30] 6th try --- .github/workflows/cd-firebase.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index fc810ae0a..54171796e 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -42,6 +42,8 @@ jobs: run: | mkdir -p composeApp/src/release/ # Ensure the directory exists echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/src/release/google-services.json + mkdir -p app/ # Ensure the directory exists + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json shell: bash - name: Decode Keystore and Create local.properties From 5cbe948aca52ae0a480cd7d5b1e717a42c43611b Mon Sep 17 00:00:00 2001 From: Al-Qassim <71926296+Al-Qassim@users.noreply.github.com> Date: Sat, 23 Aug 2025 16:59:29 +0300 Subject: [PATCH 13/30] 7th try --- .../evolvefit/design_system/theme/AppTheme.android.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composeApp/src/androidMain/kotlin/com/cairosquad/evolvefit/design_system/theme/AppTheme.android.kt b/composeApp/src/androidMain/kotlin/com/cairosquad/evolvefit/design_system/theme/AppTheme.android.kt index aaaf43bc6..a3bce5eb8 100644 --- a/composeApp/src/androidMain/kotlin/com/cairosquad/evolvefit/design_system/theme/AppTheme.android.kt +++ b/composeApp/src/androidMain/kotlin/com/cairosquad/evolvefit/design_system/theme/AppTheme.android.kt @@ -22,8 +22,8 @@ actual fun UpdateStatusBarIconsForTheme() { isAppearanceLightNavigationBars = !Theme.isDark } - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { - WindowCompat.setDecorFitsSystemWindows(window, false) - window.navigationBarColor = Theme.color.surfaces.surface.toArgb() - } +// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { +// WindowCompat.setDecorFitsSystemWindows(window, false) +// window.navigationBarColor = Theme.color.surfaces.surface.toArgb() +// } } \ No newline at end of file From 4611a8f738b7eb861874451b02ddae049f13927f Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Sun, 24 Aug 2025 22:11:49 +0300 Subject: [PATCH 14/30] Refactor: update Firebase CD workflow --- .github/workflows/cd-firebase.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 54171796e..915fa9756 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -5,7 +5,6 @@ on: branches: - develop - master - - feature/cd-firebase jobs: deploy: @@ -40,8 +39,6 @@ jobs: env: GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} run: | - mkdir -p composeApp/src/release/ # Ensure the directory exists - echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/src/release/google-services.json mkdir -p app/ # Ensure the directory exists echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json shell: bash @@ -69,16 +66,7 @@ jobs: run: | ./gradlew assembleRelease --build-cache -x test -x lint - ls -l app/build/outputs/apk/release/app-release.apk || { echo "apk not generated"; exit 1; } - - - name: Extract Release Notes - id: release_notes - run: | - COMMIT_MSG=$(git log -1 --pretty=%B | sed 's/"/\\"/g' | tr -d '\n') - TRUNCATED_MSG="${COMMIT_MSG:0:500}" - echo "$TRUNCATED_MSG" > release_notes.txt - echo "notes=$TRUNCATED_MSG" >> $GITHUB_OUTPUT - echo "Release notes: $TRUNCATED_MSG" + ls -l composeApp/build/outputs/apk/release/composeApp-release.apk || { echo "apk not generated"; exit 1; } - name: Upload APKs to Firebase App Distribution env: @@ -87,8 +75,8 @@ jobs: run: | npm install -g firebase-tools firebase appdistribution:distribute \ - app/build/outputs/apk/release/app-release.apk \ + composeApp/build/outputs/apk/release/composeApp-release.apk \ --app "$FIREBASE_APP_ID" \ --token "$FIREBASE_AUTH_TOKEN" \ --groups "cairo_squad" \ - --release-notes-file release_notes.txt + --release-notes-file release_notes.txt \ No newline at end of file From 06337f45dc858d7b00090af5a139db30f19655b8 Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 03:11:15 +0300 Subject: [PATCH 15/30] feat: add feature/cd-firebase branch to cd workflow --- .github/workflows/cd-firebase.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 915fa9756..6ed5b6891 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -5,6 +5,7 @@ on: branches: - develop - master + - feature/cd-firebase jobs: deploy: From ac3554c28237a03d6ed609986330471e2727c436 Mon Sep 17 00:00:00 2001 From: Al-Qassim <71926296+Al-Qassim@users.noreply.github.com> Date: Thu, 28 Aug 2025 03:12:04 +0300 Subject: [PATCH 16/30] 8th --- .github/workflows/cd-firebase.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 54171796e..6ed5b6891 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -40,8 +40,6 @@ jobs: env: GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} run: | - mkdir -p composeApp/src/release/ # Ensure the directory exists - echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/src/release/google-services.json mkdir -p app/ # Ensure the directory exists echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json shell: bash @@ -69,16 +67,7 @@ jobs: run: | ./gradlew assembleRelease --build-cache -x test -x lint - ls -l app/build/outputs/apk/release/app-release.apk || { echo "apk not generated"; exit 1; } - - - name: Extract Release Notes - id: release_notes - run: | - COMMIT_MSG=$(git log -1 --pretty=%B | sed 's/"/\\"/g' | tr -d '\n') - TRUNCATED_MSG="${COMMIT_MSG:0:500}" - echo "$TRUNCATED_MSG" > release_notes.txt - echo "notes=$TRUNCATED_MSG" >> $GITHUB_OUTPUT - echo "Release notes: $TRUNCATED_MSG" + ls -l composeApp/build/outputs/apk/release/composeApp-release.apk || { echo "apk not generated"; exit 1; } - name: Upload APKs to Firebase App Distribution env: @@ -87,8 +76,8 @@ jobs: run: | npm install -g firebase-tools firebase appdistribution:distribute \ - app/build/outputs/apk/release/app-release.apk \ + composeApp/build/outputs/apk/release/composeApp-release.apk \ --app "$FIREBASE_APP_ID" \ --token "$FIREBASE_AUTH_TOKEN" \ --groups "cairo_squad" \ - --release-notes-file release_notes.txt + --release-notes-file release_notes.txt \ No newline at end of file From 8f57dd9c1e63e047414f9138024a862015c50d3e Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 03:23:41 +0300 Subject: [PATCH 17/30] Fix: Update path for google-services.json and keystore in CD workflow --- .github/workflows/cd-firebase.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 6ed5b6891..bc84dc515 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -40,8 +40,8 @@ jobs: env: GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} run: | - mkdir -p app/ # Ensure the directory exists - echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json + mkdir -p composeApp/ # Ensure the directory exists + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json shell: bash - name: Decode Keystore and Create local.properties @@ -52,8 +52,8 @@ jobs: KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} run: | - rm -f app/JKS.jks local.properties release_notes.txt - echo "$KEYSTORE" | base64 -d > app/JKS.jks + rm -f composeApp/JKS.jks local.properties release_notes.txt + echo "$KEYSTORE" | base64 -d > composeApp/JKS.jks echo "KEYSTORE_PASSWORD = $KEYSTORE_PASSWORD" >> local.properties echo "KEY_ALIAS = $KEY_ALIAS" >> local.properties echo "KEY_PASSWORD = $KEY_PASSWORD" >> local.properties From 298d8736505d2252c6bb5691d23dce80c26676eb Mon Sep 17 00:00:00 2001 From: Al-Qassim <71926296+Al-Qassim@users.noreply.github.com> Date: Thu, 28 Aug 2025 03:25:36 +0300 Subject: [PATCH 18/30] 9th --- .github/workflows/cd-firebase.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 6ed5b6891..bc84dc515 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -40,8 +40,8 @@ jobs: env: GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} run: | - mkdir -p app/ # Ensure the directory exists - echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json + mkdir -p composeApp/ # Ensure the directory exists + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json shell: bash - name: Decode Keystore and Create local.properties @@ -52,8 +52,8 @@ jobs: KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} run: | - rm -f app/JKS.jks local.properties release_notes.txt - echo "$KEYSTORE" | base64 -d > app/JKS.jks + rm -f composeApp/JKS.jks local.properties release_notes.txt + echo "$KEYSTORE" | base64 -d > composeApp/JKS.jks echo "KEYSTORE_PASSWORD = $KEYSTORE_PASSWORD" >> local.properties echo "KEY_ALIAS = $KEY_ALIAS" >> local.properties echo "KEY_PASSWORD = $KEY_PASSWORD" >> local.properties From 0213af86a4ec99e8d50bd9ca34e286f6dee33edc Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 03:49:44 +0300 Subject: [PATCH 19/30] Refactor: Remove unused Firebase plugin versions from TOML --- gradle/libs.versions.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0a1c0554d..642bb4f0c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -30,8 +30,6 @@ googleGmsGoogleServices = "4.4.3" room = "2.7.2" sqlite = "2.5.2" ksp = "2.2.0-2.0.2" -googleFirebaseAppdistribution = "5.1.1" -googleGmsGoogleServices = "4.4.3" [libraries] compose-shadow = { module = "com.adamglin:compose-shadow", version.ref = "composeShadow" } From 7d692483ce18bc306c811815af4de6b2058b1c6d Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 04:00:52 +0300 Subject: [PATCH 20/30] Fix: Update APK path in CD workflow --- .github/workflows/cd-firebase.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index bc84dc515..5ee94f44e 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -50,7 +50,6 @@ jobs: KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} KEY_ALIAS: ${{ secrets.KEY_ALIAS }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} - run: | rm -f composeApp/JKS.jks local.properties release_notes.txt echo "$KEYSTORE" | base64 -d > composeApp/JKS.jks @@ -64,10 +63,9 @@ jobs: KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} KEY_ALIAS: ${{ secrets.KEY_ALIAS }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} - run: | ./gradlew assembleRelease --build-cache -x test -x lint - ls -l composeApp/build/outputs/apk/release/composeApp-release.apk || { echo "apk not generated"; exit 1; } + ls -l release/composeApp-release.apk || { echo "apk not generated"; exit 1; } - name: Upload APKs to Firebase App Distribution env: @@ -76,7 +74,7 @@ jobs: run: | npm install -g firebase-tools firebase appdistribution:distribute \ - composeApp/build/outputs/apk/release/composeApp-release.apk \ + release/composeApp-release.apk \ --app "$FIREBASE_APP_ID" \ --token "$FIREBASE_AUTH_TOKEN" \ --groups "cairo_squad" \ From 4a09a5c9bcfbf3f45d312e5f371ebc8fa5e0f2b5 Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 04:08:39 +0300 Subject: [PATCH 21/30] feat: automate release notes for Firebase App Distribution --- .github/workflows/cd-firebase.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 5ee94f44e..c87929fd7 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -1,5 +1,9 @@ name: EvolveFit CD Pipeline +permissions: + contents: write + workflows: write + on: push: branches: @@ -67,6 +71,10 @@ jobs: ./gradlew assembleRelease --build-cache -x test -x lint ls -l release/composeApp-release.apk || { echo "apk not generated"; exit 1; } + - name: Create Release Notes + run: | + echo "Automated build from GitHub Actions on $(date)" > release_notes.txt + - name: Upload APKs to Firebase App Distribution env: FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} From cd629fb43eee60da6ea0657784a186207b86f9cc Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 04:21:27 +0300 Subject: [PATCH 22/30] Remove unused workflow permissions --- .github/workflows/cd-firebase.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index c87929fd7..42fd638d6 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -1,9 +1,4 @@ name: EvolveFit CD Pipeline - -permissions: - contents: write - workflows: write - on: push: branches: From db43c0a6dbefc50a385e1681da97063e336065b4 Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 04:51:17 +0300 Subject: [PATCH 23/30] Fix: Update APK path in Firebase CD workflow --- .github/workflows/cd-firebase.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 42fd638d6..237fc8e5d 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -64,7 +64,7 @@ jobs: KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} run: | ./gradlew assembleRelease --build-cache -x test -x lint - ls -l release/composeApp-release.apk || { echo "apk not generated"; exit 1; } + ls -l composeApp/build/outputs/apk/release/composeApp-release.apk || { echo "apk not generated"; exit 1; } - name: Create Release Notes run: | @@ -77,7 +77,7 @@ jobs: run: | npm install -g firebase-tools firebase appdistribution:distribute \ - release/composeApp-release.apk \ + composeApp/build/outputs/apk/release/composeApp-release.apk \ --app "$FIREBASE_APP_ID" \ --token "$FIREBASE_AUTH_TOKEN" \ --groups "cairo_squad" \ From cc950eec79a4eaa678f64d7309b7aacdd9a5d6ae Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 04:58:31 +0300 Subject: [PATCH 24/30] 10th --- .github/workflows/cd-firebase.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 237fc8e5d..e0b8912d0 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -39,7 +39,7 @@ jobs: env: GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} run: | - mkdir -p composeApp/ # Ensure the directory exists + mkdir -p composeApp/ echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json shell: bash @@ -57,14 +57,13 @@ jobs: echo "KEY_PASSWORD = $KEY_PASSWORD" >> local.properties - name: Generate Signed APK - env: - KEYSTORE: ${{ secrets.KEYSTORE }} - KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} - KEY_ALIAS: ${{ secrets.KEY_ALIAS }} - KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} run: | ./gradlew assembleRelease --build-cache -x test -x lint - ls -l composeApp/build/outputs/apk/release/composeApp-release.apk || { echo "apk not generated"; exit 1; } + + - name: Find APKs + run: | + echo "Searching for APKs..." + find . -type f -name "*.apk" - name: Create Release Notes run: | @@ -77,7 +76,7 @@ jobs: run: | npm install -g firebase-tools firebase appdistribution:distribute \ - composeApp/build/outputs/apk/release/composeApp-release.apk \ + composeApp/build/outputs/apk/release/composeApp-release.apk \ --app "$FIREBASE_APP_ID" \ --token "$FIREBASE_AUTH_TOKEN" \ --groups "cairo_squad" \ From e94b5b8f2e2902336f13aa9c7af2c6aa2910fed9 Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 05:06:56 +0300 Subject: [PATCH 25/30] 11th --- composeApp/build.gradle.kts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index d6c6accd4..b9734f6a8 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -127,7 +127,7 @@ android { signingConfigs { create("release") { - storeFile = file("JKS") + storeFile = file("composeApp/JKS.jks") storePassword = locals.getProperty("KEYSTORE_PASSWORD") keyAlias = locals.getProperty("KEY_ALIAS") keyPassword = locals.getProperty("KEY_PASSWORD") @@ -138,9 +138,15 @@ android { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } +// buildTypes { +// getByName("release") { +// isMinifyEnabled = false +// } +// } buildTypes { getByName("release") { isMinifyEnabled = false + signingConfig = signingConfigs.getByName("release") } } compileOptions { From c5ec1117fedb893658730b70344bb9ec8cbe9c61 Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 05:11:10 +0300 Subject: [PATCH 26/30] 12th --- composeApp/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index b9734f6a8..a92a103ff 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -127,7 +127,7 @@ android { signingConfigs { create("release") { - storeFile = file("composeApp/JKS.jks") + storeFile = file("JKS.jks") storePassword = locals.getProperty("KEYSTORE_PASSWORD") keyAlias = locals.getProperty("KEY_ALIAS") keyPassword = locals.getProperty("KEY_PASSWORD") From 08971aa87257a43519e9213018b5a7ba2e2704c2 Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 14:50:01 +0300 Subject: [PATCH 27/30] refactor: Enable ProGuard and resource shrinking for release builds --- composeApp/build.gradle.kts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index a92a103ff..18404f195 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -142,6 +142,16 @@ android { // getByName("release") { // isMinifyEnabled = false // } +// } +// buildTypes { +// getByName("release") { +// isMinifyEnabled = true +// isShrinkResources = true // يقلل الصور + XML +// proguardFiles( +// getDefaultProguardFile("proguard-android-optimize.txt"), +// "proguard-rules.pro" +// ) +// } // } buildTypes { getByName("release") { From 3d43e2b024ccbbe7c6bfdf342ef81259433ff98a Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Thu, 28 Aug 2025 15:21:30 +0300 Subject: [PATCH 28/30] Refactor: Streamline Android CI workflow --- .github/workflows/android-ci.yml | 96 ++++++++------------------------ 1 file changed, 23 insertions(+), 73 deletions(-) diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml index 8318ca937..8405c4849 100644 --- a/.github/workflows/android-ci.yml +++ b/.github/workflows/android-ci.yml @@ -1,91 +1,41 @@ -name: EvolveFit CD Pipeline +name: Android CI on: push: branches: + - main - develop - - master + pull_request: + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + JAVA_VERSION: 21 jobs: - deploy: + android-build: + name: Android Build runs-on: ubuntu-latest + timeout-minutes: 30 steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up JDK + - name: Setup Java uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: '21' - - - name: Cache Gradle - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - gradle-${{ runner.os }}- - - - name: Make gradlew executable - run: chmod +x ./gradlew - - - name: Create google-services.json - env: - GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} - run: | - mkdir -p composeApp/ # Ensure the directory exists - echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json - shell: bash + java-version: ${{ env.JAVA_VERSION }} - - name: Decode Keystore and Create local.properties - env: - KEYSTORE: ${{ secrets.KEYSTORE }} - KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} - KEY_ALIAS: ${{ secrets.KEY_ALIAS }} - KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + - name: Build Android App + run: ./gradlew :composeApp:assembleDebug - run: | - rm -f app/JKS.jks local.properties release_notes.txt - echo "$KEYSTORE" | base64 -d > app/JKS.jks - echo "KEYSTORE_PASSWORD = $KEYSTORE_PASSWORD" >> local.properties - echo "KEY_ALIAS = $KEY_ALIAS" >> local.properties - echo "KEY_PASSWORD = $KEY_PASSWORD" >> local.properties - - - name: Generate Signed APK - env: - KEYSTORE: ${{ secrets.KEYSTORE }} - KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} - KEY_ALIAS: ${{ secrets.KEY_ALIAS }} - KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} - - run: | - ./gradlew assembleRelease --build-cache -x test -x lint - ls -l app/build/outputs/apk/release/app-release.apk || { echo "apk not generated"; exit 1; } - - - name: Extract Release Notes - id: release_notes - run: | - COMMIT_MSG=$(git log -1 --pretty=%B | sed 's/"/\\"/g' | tr -d '\n') - TRUNCATED_MSG="${COMMIT_MSG:0:500}" - echo "$TRUNCATED_MSG" > release_notes.txt - echo "notes=$TRUNCATED_MSG" >> $GITHUB_OUTPUT - echo "Release notes: $TRUNCATED_MSG" - - - name: Upload APKs to Firebase App Distribution - env: - FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} - FIREBASE_AUTH_TOKEN: ${{ secrets.FIREBASE_AUTH_TOKEN }} - run: | - npm install -g firebase-tools - firebase appdistribution:distribute \ - app/build/outputs/apk/release/app-release.apk \ - --app "$FIREBASE_APP_ID" \ - --token "$FIREBASE_AUTH_TOKEN" \ - --groups "cairo_squad" \ - --release-notes-file release_notes.txt + - name: Upload Android APK + if: github.event_name == 'push' + uses: actions/upload-artifact@v4 + with: + name: android-apk-debug + path: composeApp/build/outputs/apk/debug/*.apk \ No newline at end of file From 6e23afc4d063dafabf673fad94b83e82b86035fd Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Wed, 3 Sep 2025 10:45:26 +0300 Subject: [PATCH 29/30] Fix: Resolve CI/CD build failures --- .github/workflows/android-ci.yml | 9 ++++++++- .github/workflows/cd-firebase.yml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml index 8405c4849..fb3636c1e 100644 --- a/.github/workflows/android-ci.yml +++ b/.github/workflows/android-ci.yml @@ -29,7 +29,14 @@ jobs: with: distribution: 'zulu' java-version: ${{ env.JAVA_VERSION }} - + - name: Create google-services.json + env: + GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} + run: | + mkdir -p composeApp/ + mkdir -p composeApp/src/debug/ + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json + cp composeApp/google-services.json composeApp/src/debug/google-services.json - name: Build Android App run: ./gradlew :composeApp:assembleDebug diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index e0b8912d0..35efbda72 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -41,6 +41,7 @@ jobs: run: | mkdir -p composeApp/ echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > composeApp/google-services.json shell: bash - name: Decode Keystore and Create local.properties From 0dcf2391c0a0f1d597ff53c6d2351b5e83c96681 Mon Sep 17 00:00:00 2001 From: Elsayed Magdy Date: Wed, 3 Sep 2025 10:59:12 +0300 Subject: [PATCH 30/30] refactor: Enable ProGuard for release builds and update CD workflow --- .github/workflows/cd-firebase.yml | 2 +- composeApp/build.gradle.kts | 30 ++++++++++++------------------ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/cd-firebase.yml b/.github/workflows/cd-firebase.yml index 35efbda72..485a5af72 100644 --- a/.github/workflows/cd-firebase.yml +++ b/.github/workflows/cd-firebase.yml @@ -2,8 +2,8 @@ name: EvolveFit CD Pipeline on: push: branches: + - main - develop - - master - feature/cd-firebase jobs: diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 137a3ad74..3ba4a771f 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -3,8 +3,6 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget import java.io.FileInputStream import java.util.Properties import kotlin.apply -import java.io.FileInputStream -import java.util.Properties plugins { alias(libs.plugins.kotlinMultiplatform) @@ -140,27 +138,23 @@ android { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } -// buildTypes { -// getByName("release") { -// isMinifyEnabled = false -// } -// } -// buildTypes { -// getByName("release") { -// isMinifyEnabled = true -// isShrinkResources = true // يقلل الصور + XML -// proguardFiles( -// getDefaultProguardFile("proguard-android-optimize.txt"), -// "proguard-rules.pro" -// ) -// } -// } buildTypes { getByName("release") { - isMinifyEnabled = false + isMinifyEnabled = true + isShrinkResources = true signingConfig = signingConfigs.getByName("release") + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) } } +// buildTypes { +// getByName("release") { +// isMinifyEnabled = false +// signingConfig = signingConfigs.getByName("release") +// } +// } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11