diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml
index d0c1dd4..f0422b4 100644
--- a/.github/workflows/build-and-test.yaml
+++ b/.github/workflows/build-and-test.yaml
@@ -15,6 +15,14 @@ on:
required: true
default: 'main'
type: string
+ android_variant:
+ description: 'Android build variant'
+ required: true
+ default: 'dev'
+ type: choice
+ options:
+ - dev
+ - prod
jobs:
build-and-test-web-and-api:
@@ -67,6 +75,9 @@ jobs:
build-and-test-android:
name: Build and Test Android
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ variant: [dev, prod]
steps:
- name: Checkout repository
@@ -89,19 +100,40 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x android/gradlew
+ - name: Create debug keystore
+ run: |
+ mkdir -p ~/.android
+ keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
+
+ - name: Create google-services.json for dev
+ if: matrix.variant == 'dev'
+ run: |
+ mkdir -p android/app/src/dev
+ echo '${{ secrets.GOOGLE_SERVICES_JSON_DEV }}' > android/app/src/dev/google-services.json
+
+ - name: Create google-services.json for prod
+ if: matrix.variant == 'prod'
+ run: |
+ mkdir -p android/app/src/prod
+ echo '${{ secrets.GOOGLE_SERVICES_JSON_PROD }}' > android/app/src/prod/google-services.json
+
- name: Build Android app
run: |
cd android
- ./gradlew assembleDebug
+ ./gradlew assemble${{ matrix.variant }}Debug
# - name: Run Android tests
# run: |
# cd android
- # ./gradlew testDebugUnitTest
+ # ./gradlew test${{ matrix.variant }}DebugUnitTest
+
+ - name: Sanitize ref name for artifact
+ shell: bash
+ run: echo "SAFE_REF_NAME=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
- name: textbee.dev-build-${{ github.ref_name }}-${{ github.sha }}.apk
- path: android/app/build/outputs/apk/debug/app-debug.apk
+ name: textbee-${{ matrix.variant }}-build-${{ env.SAFE_REF_NAME }}-${{ github.sha }}.apk
+ path: android/app/build/outputs/apk/${{ matrix.variant }}/debug/app-${{ matrix.variant }}-debug.apk
retention-days: 7
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 9cf01b5..586d6fc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
.vercel
.DS_Store
*-monitor
+
+.cursor
\ No newline at end of file
diff --git a/android/.gitignore b/android/.gitignore
index b08a615..f511e00 100644
--- a/android/.gitignore
+++ b/android/.gitignore
@@ -13,4 +13,11 @@
.externalNativeBuild
.cxx
local.properties
-/app/release/*
\ No newline at end of file
+/app/release/*
+
+*.apk
+
+# Firebase configuration files
+/app/src/dev/google-services.json
+/app/src/prod/google-services.json
+/app/google-services.json
\ No newline at end of file
diff --git a/android/.idea/compiler.xml b/android/.idea/compiler.xml
index fb7f4a8..b589d56 100644
--- a/android/.idea/compiler.xml
+++ b/android/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/android/.idea/deploymentTargetDropDown.xml b/android/.idea/deploymentTargetDropDown.xml
new file mode 100644
index 0000000..83eadcf
--- /dev/null
+++ b/android/.idea/deploymentTargetDropDown.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml
index a2d7c21..cb865f6 100644
--- a/android/.idea/gradle.xml
+++ b/android/.idea/gradle.xml
@@ -4,15 +4,15 @@
diff --git a/android/.idea/migrations.xml b/android/.idea/migrations.xml
new file mode 100644
index 0000000..f8051a6
--- /dev/null
+++ b/android/.idea/migrations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml
index 42d4ab2..b34d1d5 100644
--- a/android/.idea/misc.xml
+++ b/android/.idea/misc.xml
@@ -1,4 +1,3 @@
-