From c142c823d31bcda98ab72f89d2f9d04232cfe801 Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Wed, 5 Apr 2023 00:12:09 +0200 Subject: [PATCH] Add hangar-publishing --- implementations/spigot/build.gradle.kts | 31 ++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/implementations/spigot/build.gradle.kts b/implementations/spigot/build.gradle.kts index 6df2992c..fb0b7aab 100644 --- a/implementations/spigot/build.gradle.kts +++ b/implementations/spigot/build.gradle.kts @@ -5,6 +5,7 @@ plugins { id ("com.github.node-gradle.node") version "3.0.1" id ("com.github.johnrengelman.shadow") version "7.1.2" id ("com.modrinth.minotaur") version "2.+" + id ("io.papermc.hangar-publish-plugin") version "0.0.4" } group = "de.bluecolored.bluemap.bukkit" @@ -120,7 +121,7 @@ modrinth { token.set(System.getenv("MODRINTH_TOKEN")) projectId.set("swbUV1cr") versionNumber.set("${project.version}-${project.name}") - changelog.set("Releasenotes and Changelog:\nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}") + changelog.set("Releasenotes and Changelog: \nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}") uploadFile.set(tasks.findByName("shadowJar")) loaders.addAll("spigot") gameVersions.addAll( @@ -134,6 +135,34 @@ modrinth { ) } +hangarPublish { + publications.register("plugin") { + version.set(project.version as String) + namespace("Blue", "BlueMap") + channel.set("Release") + changelog.set("Releasenotes and Changelog: \nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}") + + apiKey.set(System.getenv("HANGAR_TOKEN")) + + // register platforms + platforms { + register(io.papermc.hangarpublishplugin.model.Platforms.PAPER) { + jar.set(tasks.jar.flatMap { it.archiveFile }) + platformVersions.set(listOf( + "1.13.2", + "1.14", "1.14.1", "1.14.2", "1.14.3", "1.14.4", + "1.15", "1.15.1", "1.15.2", + "1.16", "1.16.1", "1.16.2", "1.16.3", "1.16.4", "1.16.5", + "1.17", "1.17.1", + "1.18", "1.18.1", "1.18.2", + "1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4" + )) + } + } + } +} + tasks.register("publish") { dependsOn("modrinth") + dependsOn("publishPluginPublicationsToHangar") }