Skip to content

Commit

Permalink
Add Hangar publish plugin and update necessary files
Browse files Browse the repository at this point in the history
  • Loading branch information
NonSwag committed Aug 1, 2024
1 parent 4f47fb0 commit dd14301
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![](https://github.com/TheNextLvl-net/creative-utilities/blob/master/images/buildersutilities-banner.png?raw=true)
**![](https://github.com/TheNextLvl-net/creative-utilities/blob/master/images/buildersutilities-banner.png?raw=true)

---

Expand All @@ -23,4 +23,4 @@ project.
## Suggestions

Suggestions are welcome! We have a separate issue form for suggestions, which can be
found [here](https://github.com/TheNextLvl-net/creative-utilities/issues/new?projects=&template=feature_request.yml).
found [here](https://github.com/TheNextLvl-net/creative-utilities/issues/new?projects=&template=feature_request.yml).**
22 changes: 22 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import io.papermc.hangarpublishplugin.model.Platforms
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
import net.minecrell.pluginyml.paper.PaperPluginDescription

plugins {
id("java")
id("io.github.goooler.shadow") version "8.1.7"
id("io.papermc.hangar-publish-plugin") version "0.1.2"
id("net.minecrell.plugin-yml.paper") version "0.6.0"
}

Expand Down Expand Up @@ -83,3 +85,23 @@ paper {
}
}
}

val versionString: String = project.version as String
val isRelease: Boolean = !versionString.contains("-pre")

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

hangarPublish { // docs - https://docs.papermc.io/misc/hangar-publishing
publications.register("paper") {
id.set("CreativeUtilities")
version.set(versionString)
channel.set(if (isRelease) "Release" else "Snapshot")
apiKey.set(System.getenv("HANGAR_API_TOKEN"))
platforms.register(Platforms.PAPER) {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(versions)
}
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
game.versions=1.21
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.parallel=true

0 comments on commit dd14301

Please sign in to comment.