Skip to content

Commit

Permalink
Try to fix publishing of hanagr
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMeinerLP committed Mar 16, 2023
1 parent e83f95a commit 499be53
Showing 1 changed file with 46 additions and 12 deletions.
58 changes: 46 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io.papermc.hangarpublishplugin.model.Platforms
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription.Permission.Default

plugins {
kotlin("jvm") version "1.8.10"
id("com.github.johnrengelman.shadow") version "7.1.2"
Expand Down Expand Up @@ -78,11 +79,14 @@ changelog {
hangarPublish {
if (System.getenv().containsKey("CI")) {
publications.register("Attollo") {
val finalVersion = if (System.getenv("GITHUB_REF_NAME") in listOf("main", "master")) {
"$baseVersion-RELEASE"
} else {
baseVersion + "-SNAPSHOT+" + System.getenv("SHA_SHORT")
}
val finalVersion =
if (System.getenv("GITHUB_REF_NAME") in listOf("main", "master") || System.getenv("GITHUB_REF_NAME")
.startsWith("v")
) {
"$baseVersion-RELEASE"
} else {
baseVersion + "-SNAPSHOT+" + System.getenv("SHA_SHORT")
}
version.set(finalVersion)
channel.set(System.getenv("HANGAR_CHANNEL"))
changelog.set(project.changelog.renderItem(project.changelog.get(baseVersion)))
Expand All @@ -93,7 +97,20 @@ hangarPublish {
platforms {
register(Platforms.PAPER) {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(listOf("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"))
platformVersions.set(
listOf(
"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"
)
)
}
}
}
Expand All @@ -103,15 +120,32 @@ if (System.getenv().containsKey("CI")) {
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set("ULt9SvKn")
val finalVersion = if (System.getenv("GITHUB_REF_NAME") in listOf("main", "master")) {
"$baseVersion-RELEASE"
} else {
baseVersion + "-SNAPSHOT+" + System.getenv("SHA_SHORT")
}
val finalVersion =
if (System.getenv("GITHUB_REF_NAME") in listOf("main", "master") || System.getenv("GITHUB_REF_NAME")
.startsWith("v")
) {
"$baseVersion-RELEASE"
} else {
baseVersion + "-SNAPSHOT+" + System.getenv("SHA_SHORT")
}
versionNumber.set(finalVersion)
versionType.set(System.getenv("MODRINTH_CHANNEL"))
uploadFile.set(tasks.shadowJar as Any)
gameVersions.addAll(listOf("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"))
gameVersions.addAll(
listOf(
"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"
)
)
loaders.add("paper")
loaders.add("bukkit")
changelog.set(project.changelog.renderItem(project.changelog.get(baseVersion)))
Expand Down

0 comments on commit 499be53

Please sign in to comment.