Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

feat(mobile): store build numbers and release signing hooks for Android and iOS

debpalash7433ee95c52a
diff --git a/mobile/android/app/build.gradle.kts b/mobile/android/app/build.gradle.kts
index e4d4387ec..0397cecb9 100644
--- a/mobile/android/app/build.gradle.kts
+++ b/mobile/android/app/build.gradle.kts
@@ -15,10 +15,23 @@ android {
minSdk = 29
ndk { abiFilters += listOf("arm64-v8a", "x86_64") }
targetSdk = 36
- versionCode = appVersion.split(".").take(3).map { it.toInt() }.let { it[0]*1000000+it[1]*1000+it[2] }
+ // Play needs a unique, increasing code per upload: version * 1000 + CI build number.
+ versionCode = appVersion.split(".").take(3).map { it.toInt() }.let { it[0]*1000000+it[1]*1000+it[2] } * 1000 + (System.getenv("VS_BUILD_NUMBER")?.toInt() ?: 0)
versionName = appVersion
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
+ signingConfigs {
+ // Release signing comes from CI secrets; local builds stay unsigned-release.
+ System.getenv("VS_ANDROID_KEYSTORE")?.let { path ->
+ create("release") {
+ storeFile = file(path)
+ storePassword = System.getenv("VS_ANDROID_KEYSTORE_PASSWORD")
+ keyAlias = System.getenv("VS_ANDROID_KEY_ALIAS")
+ keyPassword = System.getenv("VS_ANDROID_KEY_PASSWORD")
+ }
+ }
+ }
+ buildTypes { release { signingConfigs.findByName("release")?.let { signingConfig = it } } }
buildFeatures { compose = true; buildConfig = true }
compileOptions { sourceCompatibility = JavaVersion.VERSION_17; targetCompatibility = JavaVersion.VERSION_17 }
testOptions { unitTests.isIncludeAndroidResources = true }
diff --git a/mobile/ios/scripts/prepare_resources.py b/mobile/ios/scripts/prepare_resources.py
index 72cdca6b5..6fdbd52af 100644
--- a/mobile/ios/scripts/prepare_resources.py
+++ b/mobile/ios/scripts/prepare_resources.py
@@ -3,6 +3,7 @@
import argparse
import hashlib
import json
+import os
import pathlib
import plistlib
import re
@@ -107,7 +108,8 @@ def prepare(output, info):
version = json.loads((ROOT / "package.json").read_text())["version"]
data = plistlib.loads((IOS / "VoiceStudio/Info.plist").read_bytes())
data["CFBundleShortVersionString"] = version
- data["CFBundleVersion"] = "1"
+ # Store uploads need a unique, increasing build per version (CI passes the run number).
+ data["CFBundleVersion"] = os.environ.get("VS_BUILD_NUMBER", "1")
data["CFBundleLocalizations"] = sorted(path.stem for path in source.glob("*.json"))
for field, keys in permissions.items():
data[field] = "\n".join(lookup(english, key) for key in keys)