mirror of
https://github.com/TibiNonEst/cauldron-dyeing.git
synced 2025-08-08 19:53:57 -05:00
Update github workflows
- Add release workflow - Add build numbers on action
This commit is contained in:
parent
38dd1d6ae7
commit
3c13e63e40
3 changed files with 55 additions and 2 deletions
28
build.gradle
28
build.gradle
|
@ -1,12 +1,14 @@
|
|||
plugins {
|
||||
id 'fabric-loom' version '0.10.+'
|
||||
id 'io.github.juuxel.loom-quiltflower-mini' version '1.2.1'
|
||||
id 'org.ajoberstar.grgit' version '4.1.0'
|
||||
}
|
||||
|
||||
sourceCompatibility = '17'
|
||||
targetCompatibility = '17'
|
||||
|
||||
version = project.mod_version
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = "${project.mod_version}${getVersionMetadata()}"
|
||||
group = project.maven_group
|
||||
|
||||
repositories {
|
||||
|
@ -65,3 +67,27 @@ jar {
|
|||
rename { "${it}_${project.archivesBaseName}"}
|
||||
}
|
||||
}
|
||||
|
||||
def getVersionMetadata() {
|
||||
def build_id = System.getenv("GITHUB_RUN_NUMBER")
|
||||
def workflow_id = System.getenv("GITHUB_WORKFLOW")
|
||||
|
||||
// CI builds only
|
||||
if (workflow_id == "build-release") {
|
||||
return "+${project.minecraft_version}"
|
||||
} else if (build_id != null) {
|
||||
return "+build.${build_id}"
|
||||
}
|
||||
|
||||
if (grgit != null) {
|
||||
def head = grgit.head()
|
||||
def id = head.abbreviatedId
|
||||
|
||||
// Flag the build if the build tree is not clean
|
||||
if (!grgit.status().clean) {
|
||||
id += "-dirty"
|
||||
}
|
||||
|
||||
return "+rev.${id}"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue