Skip to content

Agent Mesh

add google-services.json

Antonio Ojea70dec3550023
diff --git a/.github/workflows/test_flutter.yaml b/.github/workflows/test_flutter.yaml
index 4a797715..4a240942 100644
--- a/.github/workflows/test_flutter.yaml
+++ b/.github/workflows/test_flutter.yaml
@@ -17,11 +17,10 @@ on:
push:
branches:
- 'main'
- - 'mmobile'
tags:
- 'v*'
pull_request:
- branches: [ main, mmobile ]
+ branches: [ main ]
env:
GO_VERSION: "1.26"
@@ -70,6 +69,17 @@ jobs:
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
+ - name: Inject Google Services Configuration
+ env:
+ GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}
+ run: |
+ if [ -n "$GOOGLE_SERVICES_JSON_BASE64" ]; then
+ echo "[CI] Decoding google-services.json from secret..."
+ echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > mobile/sam-node-app/android/app/google-services.json
+ else
+ echo "[CI] GOOGLE_SERVICES_JSON_BASE64 secret not set, copying dummy configuration template..."
+ cp mobile/sam-node-app/android/app/google-services.json.tmpl mobile/sam-node-app/android/app/google-services.json
+ fi
- name: Run E2E Integration Test in Android Emulator
uses: ReactiveCircus/android-emulator-runner@b86636dcd5723ef0161e7f288e9bd0ad01258791 # v2.30.0
with:
@@ -80,3 +90,4 @@ jobs:
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
emulator-boot-timeout: 300
script: ./mobile/mobile_e2e.sh
+
diff --git a/Makefile b/Makefile
index 45f33cc0..0437e59c 100644
--- a/Makefile
+++ b/Makefile
@@ -52,11 +52,27 @@ mobile-ffi-ios:
mobile-ffi: mobile-ffi-host mobile-ffi-android mobile-ffi-android-x86_64 mobile-ffi-ios
mobile-app-apk: mobile-ffi-android
+ @if [ -n "$$GOOGLE_SERVICES_JSON" ]; then \
+ echo "Decoding google-services.json from GOOGLE_SERVICES_JSON environment variable..."; \
+ echo "$$GOOGLE_SERVICES_JSON" | base64 --decode > mobile/sam-node-app/android/app/google-services.json; \
+ elif [ ! -f mobile/sam-node-app/android/app/google-services.json ]; then \
+ echo "Error: google-services.json is missing."; \
+ echo "Please set GOOGLE_SERVICES_JSON environment variable with the base64-encoded configuration, or place the file directly at mobile/sam-node-app/android/app/google-services.json"; \
+ exit 1; \
+ fi
mkdir -p mobile/sam-node-app/android/app/src/main/jniLibs/arm64-v8a
cp "$(OUT_DIR)/android/libsam.so" mobile/sam-node-app/android/app/src/main/jniLibs/arm64-v8a/libsam.so
cd mobile/sam-node-app && flutter build apk --release
mobile-app-apk-emulator: mobile-ffi-android-x86_64
+ @if [ -n "$$GOOGLE_SERVICES_JSON" ]; then \
+ echo "Decoding google-services.json from GOOGLE_SERVICES_JSON environment variable..."; \
+ echo "$$GOOGLE_SERVICES_JSON" | base64 --decode > mobile/sam-node-app/android/app/google-services.json; \
+ elif [ ! -f mobile/sam-node-app/android/app/google-services.json ]; then \
+ echo "Error: google-services.json is missing."; \
+ echo "Please set GOOGLE_SERVICES_JSON environment variable with the base64-encoded configuration, or place the file directly at mobile/sam-node-app/android/app/google-services.json"; \
+ exit 1; \
+ fi
mkdir -p mobile/sam-node-app/android/app/src/main/jniLibs/x86_64
cp "$(OUT_DIR)/android-x86_64/libsam.so" mobile/sam-node-app/android/app/src/main/jniLibs/x86_64/libsam.so
cd mobile/sam-node-app && flutter build apk --release
diff --git a/mobile/sam-node-app/.gitignore b/mobile/sam-node-app/.gitignore
index 3820a95c..c82eb787 100644
--- a/mobile/sam-node-app/.gitignore
+++ b/mobile/sam-node-app/.gitignore
@@ -43,3 +43,5 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
+/android/app/google-services.json
+
diff --git a/mobile/sam-node-app/android/app/google-services.json.tmpl b/mobile/sam-node-app/android/app/google-services.json.tmpl
new file mode 100644
index 00000000..08425908
--- /dev/null
+++ b/mobile/sam-node-app/android/app/google-services.json.tmpl
@@ -0,0 +1,29 @@
+{
+ "project_info": {
+ "project_number": "123456789",
+ "project_id": "dummy-project",
+ "storage_bucket": "dummy-project.firebasestorage.app"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:123456789:android:123456789",
+ "android_client_info": {
+ "package_name": "com.example.sam_agent"
+ }
+ },
+ "oauth_client": [],
+ "api_key": [
+ {
+ "current_key": "dummy_api_key"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": []
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}