diff options
author | Harsh Shandilya <msfjarvis@gmail.com> | 2019-12-16 03:19:18 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-16 03:19:18 +0530 |
commit | e61551bf3756a49f9eb4ee03bd726f3c6167dad7 (patch) | |
tree | 2a4c60c76aa6b24fb492cb2ea57def3cc29483c7 /app/build.gradle | |
parent | 3a7c54136047c5d2d7bb807100bcc40affad65d2 (diff) |
Setup snapshot deployment (#599)
* Setup snapshot deployment
* README: Update repository links
* README: Update workflow badge link
* README: Add link to Snapshot builds
* Fix snapshot/pull-request build conflict
* Deploy from feature/deploy-snapshots as well
* Revert "Deploy from feature/deploy-snapshots as well"
Confirmed it works well
This reverts commit 06f6bc0e8c19f238643655d09ca20f83dd416283.
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Diffstat (limited to 'app/build.gradle')
-rw-r--r-- | app/build.gradle | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/app/build.gradle b/app/build.gradle index 6145fe13..9666a547 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,7 +12,30 @@ repositories { maven { url 'https://jitpack.io' } } +final def keystorePropertiesFile = rootProject.file 'keystore.properties' + +final def gitHash = { -> + final def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'describe', '--tags' + standardOutput = stdout + } + stdout.toString().trim() +} + +static final def isSnapshot() { + return System.env['GITHUB_WORKFLOW'] != null && System.env['SNAPSHOT'] != null +} + android { + if (isSnapshot()) { + android.applicationVariants.all { final variant -> + variant.outputs.all { + outputFileName = "aps_${versions.versionName}.apk" + } + } + } + defaultConfig { applicationId 'com.zeapo.pwdstore' } @@ -40,28 +63,19 @@ android { } } - /* - * To sign release builds, create the file `gradle.properties` in - * $HOME/.gradle or in your project directory with this content: - * - * mStoreFile=/path/to/key.store - * mStorePassword=xxx - * mKeyAlias=alias - * mKeyPassword=xxx - */ - if (project.hasProperty('mStoreFile') && - project.hasProperty('mStorePassword') && - project.hasProperty('mKeyAlias') && - project.hasProperty('mKeyPassword')) { + if (keystorePropertiesFile.exists()) { + final def keystoreProperties = new Properties() + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) signingConfigs { release { - storeFile = file(project.properties['mStoreFile'] as String) - storePassword = project.properties['mStorePassword'] as String - keyAlias = project.properties['mKeyAlias'] as String - keyPassword = project.properties['mKeyPassword'] as String + keyAlias = keystoreProperties['keyAlias'] + keyPassword = keystoreProperties['keyPassword'] + storeFile = rootProject.file keystoreProperties['storeFile'] + storePassword = keystoreProperties['storePassword'] } } buildTypes.release.signingConfig = signingConfigs.release + buildTypes.debug.signingConfig = signingConfigs.release } } |