Skip to content

Commit

Permalink
[ci skip] added modrinth publish
Browse files Browse the repository at this point in the history
  • Loading branch information
NonSwag committed Jul 5, 2024
1 parent ab53e6b commit 7326d29
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
id("io.github.goooler.shadow") version "8.1.7"
id("net.minecrell.plugin-yml.paper") version "0.6.0"
id("io.papermc.hangar-publish-plugin") version "0.1.2"
id("com.modrinth.minotaur") version "2.+"
}

group = project(":api").group
Expand Down Expand Up @@ -55,6 +56,10 @@ paper {
val versionString: String = project.version as String
val isRelease: Boolean = !versionString.contains("-pre")

val versions: List<String> = (property("gameVersions") as String)
.split(",")
.map { it.trim() }

hangarPublish { // docs - https://docs.papermc.io/misc/hangar-publishing
publications.register("plugin") {
id.set("CommandControl")
Expand All @@ -63,9 +68,6 @@ hangarPublish { // docs - https://docs.papermc.io/misc/hangar-publishing
apiKey.set(System.getenv("HANGAR_API_TOKEN"))
platforms.register(Platforms.PAPER) {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
val versions: List<String> = (property("paperVersion") as String)
.split(",")
.map { it.trim() }
platformVersions.set(versions)
}
platforms.register(Platforms.VELOCITY) {
Expand All @@ -76,4 +78,18 @@ hangarPublish { // docs - https://docs.papermc.io/misc/hangar-publishing
platformVersions.set(versions)
}
}
}

modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set("USLuwMUi")
versionType = if (isRelease) "release" else "beta"
uploadFile.set(tasks.shadowJar)
gameVersions.set(versions)
loaders.add("paper")
loaders.add("folia")
loaders.add("velocity")
dependencies {
optional.project("luckperms")
}
}

0 comments on commit 7326d29

Please sign in to comment.