From ecdbfe55749508d5c19fae20289fa7edfbbc8461 Mon Sep 17 00:00:00 2001 From: Archy-X <63976867+Archy-X@users.noreply.github.com> Date: Sat, 10 Aug 2024 19:04:59 -0700 Subject: [PATCH] Add Modrinth publishing --- bukkit/build.gradle.kts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bukkit/build.gradle.kts b/bukkit/build.gradle.kts index b8cec9020..f7e9f4b5b 100644 --- a/bukkit/build.gradle.kts +++ b/bukkit/build.gradle.kts @@ -5,6 +5,7 @@ plugins { `java-library` id("com.github.johnrengelman.shadow") version "7.1.2" id("io.papermc.hangar-publish-plugin") version "0.1.2" + id("com.modrinth.minotaur") version "2.+" } java.sourceCompatibility = JavaVersion.VERSION_17 @@ -132,6 +133,22 @@ if (project.hasProperty("hangarApiKey")) { } } +if (project.hasProperty("modrinthToken")) { + modrinth { + val projectVersion = project.version as String + + token.set(project.property("modrinthToken") as String) + + projectId.set("auraskills") + versionNumber.set(projectVersion) + versionType.set("release") + changelog.set(extractChangelog(projectVersion)) + uploadFile.set(tasks.shadowJar.flatMap { it.archiveFile }.get()) + gameVersions.set(supportedVersions) + loaders.set(listOf("paper", "purpur", "spigot")) + } +} + fun extractChangelog(version: String): String { val heading = Regex.escape(version) val path = if (System.getProperty("user.dir").endsWith("bukkit")) "../Changelog.md" else "Changelog.md"