Skip to content

Commit

Permalink
Do not include build number in release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jellysquid3 committed Jan 27, 2024
1 parent aa613ca commit 6af3d20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ dependencies {
def createVersionString() {
var builder = new StringBuilder()

boolean release = project.hasProperty("build.release")

String build_id = System.getenv("GITHUB_RUN_NUMBER")
String mod_version = project.mod_version as String

if (project.hasProperty("build.release")) {
if (release) {
builder.append(mod_version)
} else {
// Strip the existing pre-release version
Expand All @@ -115,10 +117,12 @@ def createVersionString() {
var minecraft_version = (project.minecraft_version as String)
builder.append("+mc").append(minecraft_version)

if (build_id != null) {
builder.append("-build.${build_id}")
} else {
builder.append("-local")
if (!release) {
if (build_id != null) {
builder.append("-build.${build_id}")
} else {
builder.append("-local")
}
}

return builder.toString()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ loader_version=0.15.0
fabric_version=0.91.1+1.20.3

# Mod Properties
mod_version=0.5.6-rc2
mod_version=0.5.6-rc.3
maven_group=me.jellysquid.mods
archives_base_name=sodium-fabric
main_class=net.caffeinemc.mods.sodium.desktop.LaunchWarn

0 comments on commit 6af3d20

Please sign in to comment.