mirror of
https://github.com/ViaVersion/ViaRewind-Legacy-Support.git
synced 2024-09-27 03:53:03 +02:00
Use Alpha channel in non-master branch
This commit is contained in:
parent
d6dec0ff11
commit
6d175f8bc7
1
.github/workflows/publish.yml
vendored
1
.github/workflows/publish.yml
vendored
@ -3,6 +3,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
|
13
build.gradle
13
build.gradle
@ -80,16 +80,27 @@ def latestCommitMessage() {
|
|||||||
return byteOut.toString('UTF-8').trim()
|
return byteOut.toString('UTF-8').trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def branchName() {
|
||||||
|
def byteOut = new ByteArrayOutputStream()
|
||||||
|
exec {
|
||||||
|
commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD'
|
||||||
|
standardOutput = byteOut
|
||||||
|
}
|
||||||
|
return byteOut.toString('UTF-8').trim()
|
||||||
|
}
|
||||||
|
|
||||||
def baseVersion = project.maven_version
|
def baseVersion = project.maven_version
|
||||||
def isRelease = !baseVersion.contains('-')
|
def isRelease = !baseVersion.contains('-')
|
||||||
def suffixedVersion = isRelease ? baseVersion : baseVersion + "+" + System.getenv("GITHUB_RUN_NUMBER")
|
def suffixedVersion = isRelease ? baseVersion : baseVersion + "+" + System.getenv("GITHUB_RUN_NUMBER")
|
||||||
def commitHash = latestCommitHash()
|
def commitHash = latestCommitHash()
|
||||||
def changelogContent = "[${commitHash}](https://github.com/ViaVersion/iaRewind-Legacy-Support/commit/${commitHash}) ${latestCommitMessage()}"
|
def changelogContent = "[${commitHash}](https://github.com/ViaVersion/iaRewind-Legacy-Support/commit/${commitHash}) ${latestCommitMessage()}"
|
||||||
|
def branch = branchName()
|
||||||
|
def isMainBranch = branch == "master"
|
||||||
hangarPublish {
|
hangarPublish {
|
||||||
publications.register("plugin") {
|
publications.register("plugin") {
|
||||||
version.set(suffixedVersion)
|
version.set(suffixedVersion)
|
||||||
id.set("ViaRewindLegacySupport")
|
id.set("ViaRewindLegacySupport")
|
||||||
channel.set(isRelease ? "Release" : "Snapshot")
|
channel.set(isRelease ? "Release" : isMainBranch ? "Snapshot" : "Alpha")
|
||||||
changelog.set(changelogContent)
|
changelog.set(changelogContent)
|
||||||
apiKey.set(System.getenv("HANGAR_TOKEN"))
|
apiKey.set(System.getenv("HANGAR_TOKEN"))
|
||||||
platforms {
|
platforms {
|
||||||
|
Loading…
Reference in New Issue
Block a user