diff --git a/Jenkinsfile b/Jenkinsfile index 935b20a..b42e1e4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,8 @@ pipeline { agent any + environment { + GITHUB_BRANCH = "${BRANCH_NAME}" + } options { buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '5') } diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index 50af7cd..c644e28 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Build changes diff --git a/build.gradle.kts b/build.gradle.kts -index c236fe5dc388f8bc0a929f1de04af94c63514208..c7c8b00a34cbc39f1003b618097bc1e2858823a1 100644 +index c236fe5dc388f8bc0a929f1de04af94c63514208..722e2aefa279e02bfef23cda8d98210072b0ed3d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,8 +13,8 @@ plugins { @@ -19,7 +19,18 @@ index c236fe5dc388f8bc0a929f1de04af94c63514208..c7c8b00a34cbc39f1003b618097bc1e2 // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") -@@ -66,7 +66,7 @@ tasks.jar { +@@ -62,11 +62,17 @@ tasks.jar { + val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim() + val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" + val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper +- val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper ++ var gitBranch: String; ++ if (System.getenv("JENKINS_URL") == null) ++ { ++ gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper ++ } else { ++ gitBranch = System.getenv("GITHUB_BRANCH") ++ } attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", @@ -28,7 +39,7 @@ index c236fe5dc388f8bc0a929f1de04af94c63514208..c7c8b00a34cbc39f1003b618097bc1e2 "Implementation-Vendor" to date, // Paper "Specification-Title" to "Bukkit", "Specification-Version" to project.version, -@@ -193,7 +193,7 @@ tasks.test { +@@ -193,7 +199,7 @@ tasks.test { fun TaskContainer.registerRunTask( name: String, block: JavaExec.() -> Unit ): TaskProvider = register(name) {