From d585d601666016494c7a3c5c58067168b1bf5034 Mon Sep 17 00:00:00 2001 From: Joshua Schirra Date: Sat, 20 Nov 2021 14:34:34 +0100 Subject: [PATCH] add curseforge publishing --- build.gradle | 27 +++++++++++++++++++++++++++ gradle.properties | 2 ++ 2 files changed, 29 insertions(+) diff --git a/build.gradle b/build.gradle index d5aeea6..1257cd4 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,7 @@ plugins { id "org.inferred.processors" version "3.3.0" id "com.github.johnrengelman.shadow" version "6.0.0" id "com.modrinth.minotaur" version "1.1.0" + id "com.matthewprenger.cursegradle" version "1.4.0" } def ENV = System.getenv() @@ -300,6 +301,29 @@ publishing { } } +curseforge { + apiKey = ENV.CURSEFORGE_TOKEN ?: "invalid" + project { + id = project.curseforge_id + releaseType = isPreviewBuild ? ((ENV.TAG && ENV.TAG.contains("-beta")) ? "beta" : "alpha") : "release" + "${project.curseforge_game_versions}".split(",").each { + addGameVersion(it) + } + + mainArtifact(remapJar) { + displayName = "${archivesBaseName} ${ENV.TAG ?: version}" + relations { + requiredDependency 'fabric-api' + embeddedLibrary 'cloth-config' + } + } + } + + options { + forgeGradleIntegration = false + } +} + task publishToModrinth(type: TaskModrinthUpload, dependsOn: assemble) { if (ENV.MODRINTH_TOKEN) { token = ENV.MODRINTH_TOKEN @@ -318,6 +342,9 @@ task publishToModrinth(type: TaskModrinthUpload, dependsOn: assemble) { if (ENV.MODRINTH_TOKEN) { tasks.publish.dependsOn(publishToModrinth) } +if (ENV.CURSEFORGE_TOKEN) { + tasks.publish.dependsOn(tasks.curseforge) +} test { diff --git a/gradle.properties b/gradle.properties index 26be519..a3e37aa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,5 +17,7 @@ requiem_version=2.0.0-alpha.12 #runtime dependencies #test mods # publishing +curseforge_id=320211 modrinth_id=XYIJ4l2k modrinth_game_versions=1.17.1 +curseforge_game_versions=1.17.1