diff --git a/gradle.properties b/gradle.properties index bf0008601..a306b442b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,8 @@ 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 mcVersionRange=1.8-1.20.1 +waterfallVersion=1.20 +velocityVersion=3.2 # Gradle properties org.gradle.daemon=true diff --git a/universal/build.gradle.kts b/universal/build.gradle.kts index 6b60dfe9d..0b6a46314 100644 --- a/universal/build.gradle.kts +++ b/universal/build.gradle.kts @@ -46,13 +46,14 @@ publishShadowJar() val branch = rootProject.branchName() val ver = (project.version as String) + "+" + System.getenv("GITHUB_RUN_NUMBER") val changelogContent = rootProject.lastCommitMessage() +val isMainBranch = branch == "master" modrinth { val mcVersions: List = (property("mcVersions") as String) .split(",") .map { it.trim() } token.set(System.getenv("MODRINTH_TOKEN")) projectId.set("viaversion") - versionType.set(if (branch == "master") "beta" else "alpha") + versionType.set(if (isMainBranch) "beta" else "alpha") versionNumber.set(ver) versionName.set("[$branch] $ver") 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 { publications.register("plugin") { version.set(ver) namespace("ViaVersion", "ViaVersion") - channel.set(if (branch == "master") "Snapshot" else "Alpha") + channel.set(if (isMainBranch) "Snapshot" else "Alpha") changelog.set(changelogContent) apiKey.set(System.getenv("HANGAR_TOKEN")) 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 }) 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)) + } } } }