mirror of
https://github.com/ViaVersion/ViaRewind-Legacy-Support.git
synced 2025-01-24 21:21:50 +01: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:
|
||||
branches:
|
||||
- master
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
|
13
build.gradle
13
build.gradle
@ -80,16 +80,27 @@ def latestCommitMessage() {
|
||||
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 isRelease = !baseVersion.contains('-')
|
||||
def suffixedVersion = isRelease ? baseVersion : baseVersion + "+" + System.getenv("GITHUB_RUN_NUMBER")
|
||||
def commitHash = latestCommitHash()
|
||||
def changelogContent = "[${commitHash}](https://github.com/ViaVersion/iaRewind-Legacy-Support/commit/${commitHash}) ${latestCommitMessage()}"
|
||||
def branch = branchName()
|
||||
def isMainBranch = branch == "master"
|
||||
hangarPublish {
|
||||
publications.register("plugin") {
|
||||
version.set(suffixedVersion)
|
||||
id.set("ViaRewindLegacySupport")
|
||||
channel.set(isRelease ? "Release" : "Snapshot")
|
||||
channel.set(isRelease ? "Release" : isMainBranch ? "Snapshot" : "Alpha")
|
||||
changelog.set(changelogContent)
|
||||
apiKey.set(System.getenv("HANGAR_TOKEN"))
|
||||
platforms {
|
||||
|
Loading…
Reference in New Issue
Block a user