Closes #121. Supersedes the separate Deploy Android workflow in #58 by attaching hesychia-<version>-<code>.aab to an android-v* Gitea release after the prod web deploy.
This commit is contained in:
1 parent
36341f6e72
commit
0d233b077c
8 files changed
+542
-18
No files matched your search
@@ -1,5 +1,17 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
// Last bundle recorded in git. Prod deploy passes -PhesychiaVersionCode and
|
||||
// -PhesychiaVersionName; these stay the floor when those properties are absent.
|
||||
def hesychiaVersionCodeFloor = 1
|
||||
def hesychiaVersionNameFloor = "0.1.0"
|
||||
|
||||
// Resolve before the android block. A parenthesized expression on the versionCode
|
||||
// setter is parsed as a cast of the setter result, so AGP throws "Value is null".
|
||||
def hesychiaVersionCodeProp = project.findProperty('hesychiaVersionCode')?.toString()?.trim()
|
||||
def hesychiaVersionNameProp = project.findProperty('hesychiaVersionName')?.toString()?.trim()
|
||||
def resolvedVersionCode = hesychiaVersionCodeProp ? hesychiaVersionCodeProp.toInteger() : hesychiaVersionCodeFloor
|
||||
def resolvedVersionName = hesychiaVersionNameProp ? hesychiaVersionNameProp : hesychiaVersionNameFloor
|
||||
|
||||
def keystorePropertiesFile = rootProject.file('keystore.properties')
|
||||
def keystoreProperties = new Properties()
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
@@ -13,8 +25,8 @@ android {
|
||||
applicationId "ai.hesychia.chat"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 1
|
||||
versionName "0.1.0"
|
||||
versionCode resolvedVersionCode
|
||||
versionName resolvedVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
@@ -27,7 +39,7 @@ android {
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keyAlias keystoreProperties['keyAlias']
|
||||
keyPassword keystoreProperties['keyPassword']
|
||||
storeFile file(keystoreProperties['storeFile'])
|
||||
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||
storePassword keystoreProperties['storePassword']
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user