mirror of
https://github.com/TibiNonEst/cauldron-dyeing.git
synced 2024-11-24 11:37:19 -05:00
Redo versioning
This commit is contained in:
parent
8f042e20cc
commit
24174cb64d
1 changed files with 12 additions and 8 deletions
20
build.gradle
20
build.gradle
|
@ -8,7 +8,7 @@ sourceCompatibility = '16'
|
||||||
targetCompatibility = '16'
|
targetCompatibility = '16'
|
||||||
|
|
||||||
archivesBaseName = project.archives_base_name
|
archivesBaseName = project.archives_base_name
|
||||||
version = "${project.mod_version}${getVersionMetadata()}"
|
version = "${project.mod_version}+${getMetadata()}"
|
||||||
group = project.maven_group
|
group = project.maven_group
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -69,18 +69,20 @@ jar {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def getVersionMetadata() {
|
def getMetadata() {
|
||||||
def build_id = System.getenv("GITHUB_RUN_NUMBER")
|
def build_id = System.getenv("GITHUB_RUN_NUMBER")
|
||||||
def workflow_id = System.getenv("GITHUB_WORKFLOW")
|
def workflow_id = System.getenv("GITHUB_WORKFLOW")
|
||||||
|
|
||||||
// CI builds only
|
def metadata = project.minecraft_version
|
||||||
|
|
||||||
|
// Release builds only
|
||||||
if (workflow_id == "build-release") {
|
if (workflow_id == "build-release") {
|
||||||
return "+${project.minecraft_version}"
|
return metadata
|
||||||
} else if (build_id != null) {
|
|
||||||
return "+build.${build_id}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (grgit != null) {
|
if (build_id != null) {
|
||||||
|
metadata += "-build.${build_id}"
|
||||||
|
} else if (grgit != null) {
|
||||||
def head = grgit.head()
|
def head = grgit.head()
|
||||||
def id = head.abbreviatedId
|
def id = head.abbreviatedId
|
||||||
|
|
||||||
|
@ -89,6 +91,8 @@ def getVersionMetadata() {
|
||||||
id += "-dirty"
|
id += "-dirty"
|
||||||
}
|
}
|
||||||
|
|
||||||
return "+rev.${id}"
|
metadata += "-${id}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return metadata
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue