Skip to content

Commit 9c5cf00

Browse files
committed
only use commit tag as version
1 parent cbded29 commit 9c5cf00

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

build.gradle

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,27 +180,18 @@ catch (Exception ignored) {
180180
}
181181

182182
// Pulls version first from the VERSION env and then git tag
183-
String identifiedVersion
184-
String versionOverride = System.getenv("VERSION") ?: null
185-
try {
186-
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
187-
}
188183
catch (Exception ignored) {
189184
out.style(Style.Failure).text(
190185
'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' +
191186
'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' +
192187
'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)'
193188
)
194189
versionOverride = 'NO-GIT-TAG-SET'
195-
identifiedVersion = versionOverride
196190
}
197-
version = minecraftVersion + '-' + identifiedVersion
191+
String versionTag = gitVersion().split("-")[gitVersion().split("-").length - 1]
192+
version = minecraftVersion + '-' + versionTag
198193
ext {
199-
modVersion = identifiedVersion
200-
}
201-
202-
if(identifiedVersion == versionOverride) {
203-
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
194+
modVersion = versionTag
204195
}
205196

206197
group = modGroup
@@ -569,7 +560,7 @@ publishing {
569560
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
570561
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
571562
// Using the identified version, not project.version as it has the prepended 1.7.10
572-
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
563+
version = System.getenv("RELEASE_VERSION") ?: versionTag
573564

574565
// remove extra garbage from minecraft and minecraftDeps configuration
575566
pom.withXml {

0 commit comments

Comments
 (0)