mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Dev: add CI to build app store releases (#468)
Adding GHA workflows to build the app store releases Also cleans up gradle build script a bit
This commit is contained in:
parent
3e2a1869ab
commit
7424f812d8
4 changed files with 123 additions and 77 deletions
|
|
@ -47,20 +47,64 @@ android {
|
|||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (shouldSign) {
|
||||
create("ci") {
|
||||
file("ci.keystore").writeBytes(
|
||||
Base64.getDecoder().decode(System.getenv("SIGNING_KEY")),
|
||||
)
|
||||
keyAlias = System.getenv("KEY_ALIAS")
|
||||
keyPassword = System.getenv("KEY_PASSWORD")
|
||||
storePassword = System.getenv("KEY_STORE_PASSWORD")
|
||||
storeFile = file("ci.keystore")
|
||||
enableV1Signing = true
|
||||
enableV2Signing = true
|
||||
enableV3Signing = true
|
||||
enableV4Signing = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro",
|
||||
)
|
||||
isDebuggable = false
|
||||
if (shouldSign) {
|
||||
signingConfig = signingConfigs.getByName("ci")
|
||||
} else {
|
||||
val localPropertiesFile = project.rootProject.file("local.properties")
|
||||
if (localPropertiesFile.exists()) {
|
||||
val properties = Properties()
|
||||
properties.load(localPropertiesFile.inputStream())
|
||||
val signingConfigName = properties["release.signing.config"]?.toString()
|
||||
if (signingConfigName != null) {
|
||||
signingConfig = signingConfigs.getByName(signingConfigName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debug {
|
||||
isMinifyEnabled = false
|
||||
isDebuggable = true
|
||||
applicationIdSuffix = ".debug"
|
||||
}
|
||||
|
||||
applicationVariants.all {
|
||||
val variant = this
|
||||
variant.outputs
|
||||
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
|
||||
.forEach { output ->
|
||||
val abi = output.getFilter("ABI").let { if (it != null) "-$it" else "" }
|
||||
val outputFileName =
|
||||
"Wholphin-${variant.baseName}-${variant.versionName}-${variant.versionCode}$abi.apk"
|
||||
output.outputFileName = outputFileName
|
||||
}
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
|
|
@ -81,63 +125,6 @@ android {
|
|||
room {
|
||||
schemaDirectory("$projectDir/schemas")
|
||||
}
|
||||
signingConfigs {
|
||||
if (shouldSign) {
|
||||
create("ci") {
|
||||
file("ci.keystore").writeBytes(
|
||||
Base64.getDecoder().decode(System.getenv("SIGNING_KEY")),
|
||||
)
|
||||
keyAlias = System.getenv("KEY_ALIAS")
|
||||
keyPassword = System.getenv("KEY_PASSWORD")
|
||||
storePassword = System.getenv("KEY_STORE_PASSWORD")
|
||||
storeFile = file("ci.keystore")
|
||||
enableV1Signing = true
|
||||
enableV2Signing = true
|
||||
enableV3Signing = true
|
||||
enableV4Signing = true
|
||||
}
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro",
|
||||
)
|
||||
if (shouldSign) {
|
||||
signingConfig = signingConfigs.getByName("ci")
|
||||
} else {
|
||||
val localPropertiesFile = project.rootProject.file("local.properties")
|
||||
if (localPropertiesFile.exists()) {
|
||||
val properties = Properties()
|
||||
properties.load(localPropertiesFile.inputStream())
|
||||
val signingConfigName = properties["release.signing.config"]?.toString()
|
||||
if (signingConfigName != null) {
|
||||
signingConfig = signingConfigs.getByName(signingConfigName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
debug {
|
||||
if (shouldSign) {
|
||||
signingConfig = signingConfigs.getByName("ci")
|
||||
}
|
||||
}
|
||||
|
||||
applicationVariants.all {
|
||||
val variant = this
|
||||
variant.outputs
|
||||
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
|
||||
.forEach { output ->
|
||||
val abi = output.getFilter("ABI").let { if (it != null) "-$it" else "" }
|
||||
val outputFileName =
|
||||
"Wholphin-${variant.baseName}-${variant.versionName}-${variant.versionCode}$abi.apk"
|
||||
output.outputFileName = outputFileName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
splits {
|
||||
abi {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue