File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ pipeline {
1313 publisherStrategy : ' EXPLICIT'
1414 ) {
1515 scmSkip(deleteBuild : true , skipPattern :' .*\\ [CI-SKIP\\ ].*' )
16+ sh ' git fetch --tags'
1617 sh ' chmod +x ./gradlew'
1718 sh ' ./gradlew clean build'
1819 }
Original file line number Diff line number Diff line change @@ -8,9 +8,11 @@ sourceCompatibility = JavaVersion.VERSION_16
88targetCompatibility = JavaVersion . VERSION_16
99
1010archivesBaseName = " ${ project.archives_base_name} -mc${ project.minecraft_version} "
11- version = project. mod_version
11+ version = project. mod_version + " . " + commitsSinceLastTag()
1212group = project. maven_group
1313
14+ getLogger(). info(" Version String: ${ version} " )
15+
1416loom {
1517 accessWidener " src/main/resources/c2me.accesswidener"
1618}
@@ -87,3 +89,17 @@ publishing {
8789 // mavenLocal()
8890 }
8991}
92+
93+ String commitsSinceLastTag () {
94+ def stdout = new ByteArrayOutputStream ()
95+ exec {
96+ commandLine ' git' , ' describe' , ' --tags'
97+ standardOutput = stdout
98+ }
99+ stdout = stdout. toString()
100+ if (stdout. indexOf(' -' ) < 0 ) {
101+ return 0 ;
102+ }
103+ def split = stdout. split(' -' )
104+ return split[split. length - 2 ]
105+ }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ minecraft_version=1.17.1-pre1
88yarn_mappings =1.17.1-pre1+build.1
99loader_version =0.11.3
1010# Mod Properties
11- mod_version =0.1-SNAPSHOT
11+ mod_version =0.2.0+alpha.1
1212maven_group =com.ishland.c2me
1313archives_base_name =c2me-fabric
1414# Java Dependencies
You can’t perform that action at this time.
0 commit comments