Introduce versioning from git tags and improve CI/CD workflows
This commit is contained in:
1 parent
989cb88e0a
commit
e13132c202
6 files changed
+58
-9
No files matched your search
@@ -2,6 +2,22 @@ plugins {
|
||||
java
|
||||
}
|
||||
|
||||
// Version: -Pversion if given, else the newest v* git tag, else 0.0.0-prerelease.
|
||||
if (version == Project.DEFAULT_VERSION)
|
||||
{
|
||||
val latestTag = providers.exec {
|
||||
workingDir = layout.settingsDirectory.asFile
|
||||
commandLine("git", "describe", "--tags", "--abbrev=0", "--match", "v*")
|
||||
isIgnoreExitValue = true
|
||||
}
|
||||
|
||||
version = latestTag.standardOutput.asText
|
||||
.map { it.trim().removePrefix("v") }
|
||||
.orElse("")
|
||||
.get()
|
||||
.ifEmpty { "0.0.0-prerelease" }
|
||||
}
|
||||
|
||||
val projectZomboid = extensions.create<ProjectZomboidExtension>("projectZomboid")
|
||||
projectZomboid.serverJar.convention(
|
||||
layout.settingsDirectory.file(
|
||||
|
||||
Reference in new issue
Block a user