From 11fd08491b407b85c3135d4c648a9b34005dd87c Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sat, 15 Apr 2023 14:23:49 -0700 Subject: [PATCH] build: setup modrinth publishing --- .github/workflows/build.yml | 6 ++++++ build-logic/build.gradle.kts | 1 + .../kotlin/carbon.platform-conventions.gradle.kts | 13 +++++++++++++ gradle/libs.versions.yml | 5 +++++ 4 files changed, 25 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef489ad1d..6d9057f07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,6 +65,12 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} title: CarbonChat ${{ steps.vars.outputs.tag }} pre-release: true + - name: Publish (Pre-)Release to Modrinth + if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.ref, '+beta.'))) }}" + run: ./gradlew :carbonchat-paper:modrinth :carbonchat-velocity:modrinth + env: + MODRINTH_TOKEN: "${{ secrets.MODRINTH_TOKEN }}" + RELEASE_NOTES: "${{ github.event.release.body }}" - name: Publish (Pre-)Release to Hangar if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.ref, '+beta.'))) }}" run: ./gradlew publishAllPublicationsToHangar diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index d13e327fc..0338034a4 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -14,6 +14,7 @@ dependencies { implementation(libs.indraLicenseHeader) implementation(libs.licenser) implementation(libs.pluginYml) + implementation(libs.minotaur) implementation("org.spongepowered:configurate-yaml:4.0.0") compileOnly("com.fasterxml.jackson.core:jackson-core:2.14.0") compileOnly("com.fasterxml.jackson.core:jackson-annotations:2.14.0") diff --git a/build-logic/src/main/kotlin/carbon.platform-conventions.gradle.kts b/build-logic/src/main/kotlin/carbon.platform-conventions.gradle.kts index d10581d64..86009819e 100644 --- a/build-logic/src/main/kotlin/carbon.platform-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/carbon.platform-conventions.gradle.kts @@ -1,5 +1,6 @@ plugins { id("carbon.base-conventions") + id("com.modrinth.minotaur") } val platformExtension = extensions.create("carbonPlatform") @@ -16,6 +17,18 @@ tasks { } } +val projectVersion = project.version as String + +modrinth { + projectId.set("QzooIsZI") + versionType.set(if (projectVersion.contains("+beta.")) "beta" else "release") + file.set(platformExtension.jarTask.flatMap { it.archiveFile }) + changelog.set(releaseNotes) + token.set(providers.environmentVariable("MODRINTH_TOKEN")) + required.project("luckperms") + gameVersions.add("1.19.4") +} + //val projectVersion = version as String //if (projectVersion.endsWith("-SNAPSHOT")) { // // Add git commit hash to version for platforms diff --git a/gradle/libs.versions.yml b/gradle/libs.versions.yml index 9dc3bf891..50ca0993f 100644 --- a/gradle/libs.versions.yml +++ b/gradle/libs.versions.yml @@ -55,6 +55,7 @@ versions: rabbitmq: 5.13.1 nats: 2.12.0 pluginYml: 0.5.3 + minotaur: 2.7.5 dependencies: adventureBom: @@ -316,6 +317,10 @@ dependencies: group: net.minecrell name: plugin-yml version: { ref: pluginYml } + minotaur: + group: com.modrinth.minotaur + name: Minotaur + version: { ref: minotaur } luckPermsApi: group: net.luckperms