change(version): use semver as part of version string

We maintain everything before since it's useful information.
This commit is contained in:
alexytomi
2026-04-01 10:10:35 +08:00
parent aace6b3efd
commit bfe3cbae6a

View File

@@ -7,7 +7,7 @@ static def getDate() { return new Date().format('yyyyMMdd') }
def getVersionName = {
// Get the last version tag, as well as the short head of the last commit
ByteArrayOutputStream TAG = new ByteArrayOutputStream()
ByteArrayOutputStream BRANCH = new ByteArrayOutputStream()
String semVer = "1.0.0"
// Used by the fallback for github actions
ByteArrayOutputStream TAG_PART_COMMIT = new ByteArrayOutputStream()
String TAG_STRING
@@ -48,17 +48,7 @@ def getVersionName = {
}
exec {
try {
commandLine 'git', 'branch', '--show-current'
ignoreExitValue true
standardOutput = BRANCH
} catch (Exception e) {
e.printStackTrace();
}
}
return TAG_STRING.trim().replace("-g", "-") + "-" + BRANCH.toString().trim()
return TAG_STRING.trim().replace("-g", "-") + "-" + semVer
}
def getCFApiKey = {