Skip to content

Commit

Permalink
Update versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed May 2, 2024
1 parent 720e12e commit fa3df87
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import git.formatLog
import git.latestCommitHash
import git.latestCommitMessage

plugins {
id("io.papermc.hangar-publish-plugin") version "0.1.2"
id("com.modrinth.minotaur") version "2.+"
Expand All @@ -7,9 +11,17 @@ plugins {
`root-plugin`
}

val buildNumber: String = System.getenv("NEXT_BUILD_NUMBER") ?: "SNAPSHOT"
val buildNumber: String? = System.getenv("NEXT_BUILD_NUMBER")

rootProject.version = if (buildNumber != null) "1.0-$buildNumber" else "1.0"

rootProject.version = "1.20.6-$buildNumber"
val isSnapshot = false

val content: String = if (isSnapshot) {
formatLog(latestCommitHash(), latestCommitMessage(), rootProject.name)
} else {
rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8)
}

subprojects.filter { it.name != "api" }.forEach {
it.project.version = rootProject.version
Expand All @@ -25,7 +37,7 @@ modrinth {
versionName.set("${rootProject.name} ${rootProject.version}")
versionNumber.set(rootProject.version as String)

changelog.set(System.getenv("COMMIT_MESSAGE"))
changelog.set(content)

uploadFile.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar"))

Expand Down

0 comments on commit fa3df87

Please sign in to comment.