Add hangar-publishing

This commit is contained in:
Lukas Rieger (Blue) 2023-04-05 00:12:09 +02:00
parent e00896561b
commit c142c823d3
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
1 changed files with 30 additions and 1 deletions

View File

@ -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")
}