mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-04-19 09:07:06 +00:00
remove all branch stuff
This commit is contained in:
parent
fc633910ba
commit
703131a727
2
.github/workflows/maven.yml
vendored
2
.github/workflows/maven.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Build with gradle
|
||||
run: ./gradlew shadowJar -Dbranch=${{ vars.GITHUB_REF_NAME }}
|
||||
run: ./gradlew shadowJar
|
||||
- name: Upload Bungee
|
||||
uses: actions/upload-artifact@v2.2.3
|
||||
with:
|
||||
|
@ -32,31 +32,15 @@ description = "RedisBungee interafaces"
|
||||
blossom {
|
||||
replaceToken("@version@", "$version")
|
||||
// GIT
|
||||
var branch: 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()
|
||||
rootProject.exec {
|
||||
standardOutput = commitStdout
|
||||
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()
|
||||
|
||||
replaceToken("@git_branch@", branch)
|
||||
replaceToken("@git_commit@", commit)
|
||||
|
||||
}
|
||||
|
||||
java {
|
||||
|
@ -3,7 +3,10 @@ package com.imaginarycode.minecraft.redisbungee;
|
||||
public class Constants {
|
||||
|
||||
public final static String VERSION = "@version@";
|
||||
public final static String GIT_BRANCH = "@git_branch@";
|
||||
public final static String GIT_COMMIT = "@git_commit@";
|
||||
|
||||
public static String getGithubCommitLink() {
|
||||
return "https://github.com/ProxioDev/RedisBungee/commit/" + GIT_COMMIT;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user