[ci skip] Add Velocity and Waterfall to publish config

This commit is contained in:
Nassim Jahnke 2023-08-11 00:39:45 +10:00
parent ef75bd567d
commit 34509e86c0
2 changed files with 14 additions and 3 deletions

View File

@ -2,6 +2,8 @@
projectVersion=4.8.0-23w32a-SNAPSHOT projectVersion=4.8.0-23w32a-SNAPSHOT
mcVersions=1.20.1, 1.19.4, 1.18.2, 1.17.1, 1.16.5, 1.15.2, 1.14.4, 1.8.9 mcVersions=1.20.1, 1.19.4, 1.18.2, 1.17.1, 1.16.5, 1.15.2, 1.14.4, 1.8.9
mcVersionRange=1.8-1.20.1 mcVersionRange=1.8-1.20.1
waterfallVersion=1.20
velocityVersion=3.2
# Gradle properties # Gradle properties
org.gradle.daemon=true org.gradle.daemon=true

View File

@ -46,13 +46,14 @@ publishShadowJar()
val branch = rootProject.branchName() val branch = rootProject.branchName()
val ver = (project.version as String) + "+" + System.getenv("GITHUB_RUN_NUMBER") val ver = (project.version as String) + "+" + System.getenv("GITHUB_RUN_NUMBER")
val changelogContent = rootProject.lastCommitMessage() val changelogContent = rootProject.lastCommitMessage()
val isMainBranch = branch == "master"
modrinth { modrinth {
val mcVersions: List<String> = (property("mcVersions") as String) val mcVersions: List<String> = (property("mcVersions") as String)
.split(",") .split(",")
.map { it.trim() } .map { it.trim() }
token.set(System.getenv("MODRINTH_TOKEN")) token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set("viaversion") projectId.set("viaversion")
versionType.set(if (branch == "master") "beta" else "alpha") versionType.set(if (isMainBranch) "beta" else "alpha")
versionNumber.set(ver) versionNumber.set(ver)
versionName.set("[$branch] $ver") versionName.set("[$branch] $ver")
changelog.set(changelogContent) changelog.set(changelogContent)
@ -67,12 +68,12 @@ modrinth {
} }
} }
if (branch == "master") { // Don't spam releases until Hangar has per channel notifications if (isMainBranch) { // Don't spam releases until Hangar has per channel notifications
hangarPublish { hangarPublish {
publications.register("plugin") { publications.register("plugin") {
version.set(ver) version.set(ver)
namespace("ViaVersion", "ViaVersion") namespace("ViaVersion", "ViaVersion")
channel.set(if (branch == "master") "Snapshot" else "Alpha") channel.set(if (isMainBranch) "Snapshot" else "Alpha")
changelog.set(changelogContent) changelog.set(changelogContent)
apiKey.set(System.getenv("HANGAR_TOKEN")) apiKey.set(System.getenv("HANGAR_TOKEN"))
platforms { platforms {
@ -80,6 +81,14 @@ if (branch == "master") { // Don't spam releases until Hangar has per channel no
jar.set(tasks.shadowJar.flatMap { it.archiveFile }) jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(listOf(property("mcVersionRange") as String)) platformVersions.set(listOf(property("mcVersionRange") as String))
} }
register(Platforms.VELOCITY) {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(listOf(property("velocityVersion") as String))
}
register(Platforms.WATERFALL) {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(listOf(property("waterfallVersion") as String))
}
} }
} }
} }