mirror of
https://github.com/sartoopjj/thefeed.git
synced 2026-05-18 04:44:36 +03:00
feat: enhance signing configuration to handle missing keystore and fallback to debug keystore
This commit is contained in:
@@ -115,11 +115,15 @@ jobs:
|
||||
cp artifacts/thefeed-client-android-arm64 android/app/src/main/jniLibs/arm64-v8a/libthefeed.so
|
||||
|
||||
- name: Decode signing keystore
|
||||
if: env.KEYSTORE_BASE64 != ''
|
||||
env:
|
||||
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
|
||||
run: |
|
||||
echo "$KEYSTORE_BASE64" | base64 -d > android/app/keystore.jks
|
||||
if [ -n "$KEYSTORE_BASE64" ]; then
|
||||
echo "$KEYSTORE_BASE64" | base64 -d > android/app/keystore.jks
|
||||
echo "Keystore decoded successfully"
|
||||
else
|
||||
echo "No KEYSTORE_BASE64 secret set — will use debug signing"
|
||||
fi
|
||||
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v4
|
||||
|
||||
@@ -37,14 +37,19 @@ android {
|
||||
// For CI: override with env vars KEYSTORE_BASE64, KEYSTORE_PASSWORD, KEY_ALIAS, KEY_PASSWORD
|
||||
release {
|
||||
def ksFile = file("keystore.jks")
|
||||
def ksBase64 = System.getenv("KEYSTORE_BASE64")
|
||||
if (ksBase64) {
|
||||
ksFile.bytes = Base64.decoder.decode(ksBase64)
|
||||
if (ksFile.exists()) {
|
||||
storeFile ksFile
|
||||
storePassword System.getenv("KEYSTORE_PASSWORD") ?: "thefeed123"
|
||||
keyAlias System.getenv("KEY_ALIAS") ?: "thefeed"
|
||||
keyPassword System.getenv("KEY_PASSWORD") ?: "thefeed123"
|
||||
} else {
|
||||
// Fallback to debug keystore for consistent local/CI builds without the project keystore
|
||||
def debugKs = new File(System.getProperty("user.home"), ".android/debug.keystore")
|
||||
storeFile debugKs
|
||||
storePassword "android"
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword "android"
|
||||
}
|
||||
storeFile ksFile
|
||||
storePassword System.getenv("KEYSTORE_PASSWORD") ?: "thefeed123"
|
||||
keyAlias System.getenv("KEY_ALIAS") ?: "thefeed"
|
||||
keyPassword System.getenv("KEY_PASSWORD") ?: "thefeed123"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user