Redo versioning

This commit is contained in:
tibs 2022-03-29 00:19:32 -04:00
parent cc0fe6f455
commit 202ba71857
Signed by untrusted user who does not match committer: tibs
GPG key ID: 047833989F50F88F

View file

@ -72,10 +72,18 @@ jar {
def getMetadata() {
def build_id = System.getenv("GITHUB_RUN_NUMBER")
def workflow_id = System.getenv("GITHUB_WORKFLOW")
def metadata = project.minecraft_version
if (grgit != null) {
// Release builds only
if (workflow_id == "build-release") {
return metadata
}
if (build_id != null) {
metadata += "-build.${build_id}"
} else if (grgit != null) {
def head = grgit.head()
def id = head.abbreviatedId
@ -87,10 +95,5 @@ def getMetadata() {
metadata += "-${id}"
}
// CI builds only
if (build_id != null) {
metadata += ".${build_id}"
}
return metadata
}