From a32d8dcbdb88c0cd47d34a203f76fdf0384d0ed5 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sun, 2 Oct 2022 21:50:16 +0200 Subject: [PATCH] Release to Modrinth (#1968) * feat: Release to Modrinth * chore: List-ify gameVersions --- .github/workflows/build.yml | 5 +++++ worldedit-bukkit/build.gradle.kts | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c548fc61..8b627b29d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,3 +70,8 @@ jobs: with: name: FastAsyncWorldEdit-Bukkit-SNAPSHOT path: worldedit-bukkit/build/libs/FastAsyncWorldEdit-Bukkit-*.jar + - name: Publish to Modrinth + if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}} + run: ./gradlew modrinth + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index cc18d1221..3bb032321 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -3,6 +3,7 @@ import io.papermc.paperweight.userdev.attribute.Obfuscation plugins { `java-library` + id("com.modrinth.minotaur") version "2.+" } project.description = "Bukkit" @@ -187,3 +188,16 @@ tasks.named("shadowJar") { tasks.named("assemble").configure { dependsOn("shadowJar") } + +tasks { + modrinth { + token.set(System.getenv("MODRINTH_TOKEN")) + projectId.set("fastasyncworldedit") + versionName.set("${project.version}") + versionNumber.set("${project.version}") + versionType.set("release") + uploadFile.set(file("build/libs/${rootProject.name}-Bukkit-${project.version}.jar")) + gameVersions.addAll(listOf("1.19.2", "1.19.1", "1.19", "1.18.2", "1.17.1", "1.16.5")) + loaders.addAll(listOf("paper", "purpur", "spigot")) + } +}