ci: A way to draft beta release

This commit is contained in:
Ahmad Ansori Palembani 2024-07-30 08:54:39 +07:00
parent 114776bc53
commit a83865e086
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
2 changed files with 57 additions and 9 deletions

View file

@ -31,6 +31,17 @@ fun runCommand(command: String): String {
return String(byteOut.toByteArray()).trim()
}
val versionName = "1.8.5"
val betaCount by lazy {
val betaTags = runCommand("git tag -l --sort=refname v${versionName}-b*")
String.format("%02d", if (betaTags.isNotEmpty()) {
val betaTag = betaTags.split("\n").last().substringAfter("-b").toIntOrNull()
((betaTag ?: 0) + 1)
} else {
1
})
}
val commitCount by lazy { runCommand("git rev-list --count HEAD") }
val commitHash by lazy { runCommand("git rev-parse --short HEAD") }
val buildTime: String by lazy {
@ -44,7 +55,7 @@ android {
defaultConfig {
applicationId = "eu.kanade.tachiyomi"
versionCode = 139
versionName = "1.8.4.3"
versionName = versionName
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
@ -94,7 +105,7 @@ android {
buildConfigField("boolean", "BETA", "true")
matchingFallbacks.add("release")
versionNameSuffix = "-b${commitCount}"
versionNameSuffix = "-b${betaCount}"
}
create("nightly") {
initWith(getByName("release"))