Skip to content

Commit

Permalink
only use commit tag as version
Browse files Browse the repository at this point in the history
  • Loading branch information
GlodBlock committed May 20, 2022
1 parent cbded29 commit 9c5cf00
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -180,27 +180,18 @@ catch (Exception ignored) {
}

// Pulls version first from the VERSION env and then git tag
String identifiedVersion
String versionOverride = System.getenv("VERSION") ?: null
try {
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
}
catch (Exception ignored) {
out.style(Style.Failure).text(
'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' +
'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' +
'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)'
)
versionOverride = 'NO-GIT-TAG-SET'
identifiedVersion = versionOverride
}
version = minecraftVersion + '-' + identifiedVersion
String versionTag = gitVersion().split("-")[gitVersion().split("-").length - 1]
version = minecraftVersion + '-' + versionTag
ext {
modVersion = identifiedVersion
}

if(identifiedVersion == versionOverride) {
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
modVersion = versionTag
}

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

// remove extra garbage from minecraft and minecraftDeps configuration
pom.withXml {
Expand Down

0 comments on commit 9c5cf00

Please sign in to comment.