From 859b382a1df0e5de6984a1a9ed89794fdb646663 Mon Sep 17 00:00:00 2001 From: Gcat101 Date: Mon, 11 Nov 2024 21:36:23 +0300 Subject: [PATCH] Try adding modrinth publishing --- fabric/build.gradle | 62 ++++++++++++++++++++++++++++++++------------- forge/build.gradle | 60 +++++++++++++++++++++++++++++-------------- gradle.properties | 7 ++--- 3 files changed, 89 insertions(+), 40 deletions(-) diff --git a/fabric/build.gradle b/fabric/build.gradle index 079d6aa94..80c0b8b17 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,6 +1,6 @@ plugins { id "com.github.johnrengelman.shadow" version "7.0.0" - id "com.matthewprenger.cursegradle" version "1.4.0" + id "me.shedaniel.unified-publishing" version "0.1.+" apply false } def ENV = System.getenv() @@ -82,24 +82,50 @@ components.java { } } -if (ENV.CURSEFORGE_KEY) { - curseforge { - apiKey = ENV.CURSEFORGE_KEY - project { - id = project.curseforge_id_fabric - releaseType = project.curseforge_type - addGameVersion "Fabric" - addGameVersion "1.16.4" - addGameVersion "1.16.5" - mainArtifact(remapJar.archivePath) - relations { - requiredDependency 'rhizo' - requiredDependency 'architectury-api' - requiredDependency 'fabric-api' - optionalDependency 'probejs-legacy' +unifiedPublishing { + project { + releaseType = project.artifact_type + gameVersions = [ + "1.16.4", + "1.16.5" + ] + gameLoaders = ["fabric", "quilt"] + displayName = "$project.mod_name Fabric $project.version" + // changelog = getGitChangelog() + mainPublication remapJar + + relations { + depends { + curseforge = modrinth = "architectury-api" + } + depends { + curseforge = modrinth = "fabric-api" + } + depends { + curseforge = "rhizo" + } + + optional { + curseforge = modrinth = "roughly-enough-items" + } + optional { + curseforge = "probejs-legacy" + } + } + + if (ENV.CURSEFORGE_KEY) { + curseforge { + token = ENV.CURSEFORGE_KEY + id = project.curseforge_id + } + } + + if (ENV.MODRINTH_TOKEN) { + modrinth { + token = ENV.MODRINTH_TOKEN + id = project.modrinth_id + version = "$project.version+$project.name" } - // changelog = getGitChangelog - // changelogType = 'markdown' } } } diff --git a/forge/build.gradle b/forge/build.gradle index 71ebc4797..454abf56b 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,6 +1,6 @@ plugins { id "com.github.johnrengelman.shadow" version "7.0.0" - id "com.matthewprenger.cursegradle" version "1.4.0" + id "me.shedaniel.unified-publishing" version "0.1.+" apply false } def ENV = System.getenv() @@ -129,25 +129,47 @@ components.java { } } -if (ENV.CURSEFORGE_KEY) { - curseforge { - apiKey = ENV.CURSEFORGE_KEY - project { - id = project.curseforge_id_forge - releaseType = project.curseforge_type - addGameVersion "Forge" - addGameVersion "1.16.4" - addGameVersion "1.16.5" - mainArtifact(remapJar.archivePath) - relations { - requiredDependency 'rhizo' - requiredDependency 'architectury-api' - optionalDependency 'jei' - optionalDependency 'game-stages' - optionalDependency 'probejs-legacy' +unifiedPublishing { + project { + releaseType = project.artifact_type + gameVersions = [ + "1.16.4", + "1.16.5" + ] + gameLoaders = ["forge"] + displayName = "$project.mod_name Forge $project.version" + // changelog = getGitChangelog() + mainPublication remapJar + + relations { + depends { + curseforge = modrinth = "architectury-api" + } + depends { + curseforge = "rhizo" + } + + optional { + curseforge = modrinth = "jei" + } + optional { + curseforge = "probejs-legacy" + } + } + + if (ENV.CURSEFORGE_KEY) { + curseforge { + token = ENV.CURSEFORGE_KEY + id = project.curseforge_id + } + } + + if (ENV.MODRINTH_TOKEN) { + modrinth { + token = ENV.MODRINTH_TOKEN + id = project.modrinth_id + version = "$project.version+$project.name" } - // changelog = getGitChangelog - // changelogType = 'markdown' } } } diff --git a/gradle.properties b/gradle.properties index 163a0870c..d547e4ad9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,13 +4,14 @@ org.gradle.caching=true mod_id=kubejs archives_base_name=kubejs +mod_name=KesseractJS mod_version=1605.3.20 maven_group=dev.latvian.mods mod_author=LatvianModder -curseforge_id_forge=1025372 -curseforge_id_fabric=1025372 -curseforge_type=release +curseforge_id=1025372 +modrinth_id=9s7vCvdT +artifact_type=release minecraft_version=1.16.5 rhizo_version_forge=5506575