2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2025-04-19 09:07:06 +00:00

test vars from github

This commit is contained in:
mohammed jasem alaajel 2023-03-23 15:21:26 +04:00
parent 693b7e6d71
commit c0470dfaf0
No known key found for this signature in database
2 changed files with 19 additions and 8 deletions

View File

@ -22,7 +22,7 @@ jobs:
java-version: '11'
distribution: 'adopt'
- name: Build with gradle
run: ./gradlew build
run: ./gradlew build -Dbranch=${{ github.ref }}
- name: shadowJar with gradle
run: ./gradlew shadowJar
- name: Upload Bungee

View File

@ -32,20 +32,31 @@ 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")
}
replaceToken("@git_branch@", "$branchStdout".replace("\n", ""))
replaceToken("@git_commit@", "$commitStdout".replace("\n", ""))
branchStdout.close()
commit = "$commitStdout".replace("\n", "");
commitStdout.close()
replaceToken("@git_branch@", branch)
replaceToken("@git_commit@", commit)
}
java {