Skip to content

Commit

Permalink
Add Modrinth publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Archy-X committed Aug 11, 2024
1 parent 81f6e14 commit ecdbfe5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit ecdbfe5

Please sign in to comment.