2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2025-04-20 01:27:07 +00:00

remove all branch stuff

This commit is contained in:
mohammed jasem alaajel 2023-03-23 15:33:29 +04:00
parent fc633910ba
commit 703131a727
No known key found for this signature in database
3 changed files with 6 additions and 19 deletions

View File

@ -22,7 +22,7 @@ jobs:
java-version: '11' java-version: '11'
distribution: 'adopt' distribution: 'adopt'
- name: Build with gradle - name: Build with gradle
run: ./gradlew shadowJar -Dbranch=${{ vars.GITHUB_REF_NAME }} run: ./gradlew shadowJar
- name: Upload Bungee - name: Upload Bungee
uses: actions/upload-artifact@v2.2.3 uses: actions/upload-artifact@v2.2.3
with: with:

View File

@ -32,31 +32,15 @@ description = "RedisBungee interafaces"
blossom { blossom {
replaceToken("@version@", "$version") replaceToken("@version@", "$version")
// GIT // GIT
var branch: String = ""
var commit: String = "" var commit: String = ""
val branchProp = System.getProperty("branch")
if (branchProp != null) {
branch = branchProp;
} else {
val branchStdout = ByteArrayOutputStream()
rootProject.exec {
standardOutput = branchStdout
commandLine("git", "branch", "--show-current")
}
branch = branchStdout.toString().replace("\n", "")
branchStdout.close()
}
val commitStdout = ByteArrayOutputStream() val commitStdout = ByteArrayOutputStream()
rootProject.exec { rootProject.exec {
standardOutput = commitStdout standardOutput = commitStdout
commandLine("git", "rev-parse", "HEAD") commandLine("git", "rev-parse", "HEAD")
} }
commit = "$commitStdout".replace("\n", ""); commit = "$commitStdout".replace("\n", "") // for some reason it adds new line so remove it.
commitStdout.close() commitStdout.close()
replaceToken("@git_branch@", branch)
replaceToken("@git_commit@", commit) replaceToken("@git_commit@", commit)
} }
java { java {

View File

@ -3,7 +3,10 @@ package com.imaginarycode.minecraft.redisbungee;
public class Constants { public class Constants {
public final static String VERSION = "@version@"; public final static String VERSION = "@version@";
public final static String GIT_BRANCH = "@git_branch@";
public final static String GIT_COMMIT = "@git_commit@"; public final static String GIT_COMMIT = "@git_commit@";
public static String getGithubCommitLink() {
return "https://github.com/ProxioDev/RedisBungee/commit/" + GIT_COMMIT;
}
} }