Local testing

This commit is contained in:
2023-08-05 14:07:54 +01:00
parent 218e0b5700
commit 9ee4a9e0ae
3 changed files with 16 additions and 20 deletions

View File

@@ -118,15 +118,11 @@ commands:
steps: steps:
# The next step will run the unit tests # The next step will run the unit tests
- run: - run:
name: Setup keystore name: Setup keystore & properties
command: | command: |
echo "$BASE64_KEYSTORE" | base64 --decode > "$PWD/app/keystore.jks"
FILE=$PWD/app/keystore.jks FILE=$PWD/app/keystore.jks
if [[ -f "$FILE" ]]; then echo "$BASE64_KEYSTORE" | base64 --decode > "$FILE"
echo "$FILE exists." printf 'releaseKeyAlias=%s\nreleaseKeyPassword=%s\nreleaseKeyStore=%s\nreleaseStorePassword=%s' $RELEASE_KEY_ALIAS $RELEASE_KEY_PASSWORD $FILE $RELEASE_STORE_PASSWORD > keystore.properties
else
echo "$FILE does not exist."
fi
- run: - run:
name: files list name: files list
command: | command: |

View File

@@ -6,9 +6,14 @@ plugins {
id 'androidx.navigation.safeargs' id 'androidx.navigation.safeargs'
} }
def relStorePassword = System.getenv("RELEASE_STORE_PASSWORD") def keyStorePropertiesFile = rootProject.file("keystore.properties")
def relKeyPassword = System.getenv("RELEASE_KEY_PASSWORD") def keyStoreProperties = new Properties()
def relKeyAlias = System.getenv("RELEASE_KEY_ALIAS") if (keyStorePropertiesFile.exists()) {
keyStoreProperties.load(new FileInputStream(keyStorePropertiesFile))
}
def keystorePath = System.getenv('PWD') + "/app/keystore.jks"
def keystore = file(keystorePath).exists() ? file(keystorePath) : null
android { android {
compileSdkVersion 31 compileSdkVersion 31
@@ -37,10 +42,10 @@ android {
signingConfigs { signingConfigs {
release { release {
storePassword relStorePassword keyAlias keyStoreProperties['releaseKeyAlias']
keyPassword relKeyPassword keyPassword keyStoreProperties['releaseKeyPassword']
keyAlias relKeyAlias storeFile keystore
storeFile rootProject.file("app/keystore.jks").exists() ? rootProject.file("app/keystore.jks") : null storePassword keyStoreProperties['releaseStorePassword']
} }
} }

View File

@@ -36,12 +36,7 @@ platform :android do
task: "clean bundle", task: "clean bundle",
flavor: "Driver", flavor: "Driver",
build_type: "Release", build_type: "Release",
properties: { )
"android.injected.signing.store.file" => ENV['PWD'] + "/app/keystore.jks",
"android.injected.signing.store.password" => ENV['RELEASE_STORE_PASSWORD'],
"android.injected.signing.key.alias" => ENV['RELEASE_KEY_ALIAS'],
"android.injected.signing.key.password" => ENV['RELEASE_KEY_PASSWORD'],
})
upload_to_play_store( upload_to_play_store(
aab: "app/build/outputs/bundle/driverRelease/app-driver-release.aab", aab: "app/build/outputs/bundle/driverRelease/app-driver-release.aab",
json_key: "google-play-key.json", json_key: "google-play-key.json",