diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/build.gradle b/build.gradle index 7969b7f..62a7bc7 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id "fabric-loom" version "1.6+" id "com.github.johnrengelman.shadow" version "8.1+" id "maven-publish" + id "me.modmuss50.mod-publish-plugin" version "0.5.2" } version = project.mod_version @@ -43,6 +44,45 @@ processResources { } } +publishMods { + displayName = "ramel ${project.version}" + file = remapJar.archiveFile + changelog = rootProject.file("CHANGELOG.md").getText() + type = STABLE + + modLoaders.add("quilt") + modLoaders.add("fabric") + + dryRun = !providers.environmentVariable("MODRINTH_TOKEN").isPresent() + || !providers.environmentVariable("CURSEFORGE_TOKEN").isPresent() + || property("pub.should_publish") == "false" + dryRun = false + + var mcVersions = [project.minecraft_version] + mcVersions.addAll(property("pub.additional_versions").toString().split(" ").findAll { !it.empty }) + + modrinth { + projectId = "4Uw92C2y" + accessToken = providers.environmentVariable("MODRINTH_TOKEN") + mcVersions.forEach(minecraftVersions::add) + + requires("fabric-api") + optional("modmenu") + } + + curseforge { + accessToken = providers.environmentVariable("CURSEFORGE_TOKEN") + projectId = "877074" + mcVersions.forEach(minecraftVersions::add) + + clientRequired = true + serverRequired = false + + requires("fabric-api") + optional("modmenu") + } +} + def targetJavaVersion = 17 tasks.withType(JavaCompile).configureEach { it.options.encoding = "UTF-8" diff --git a/gradle.properties b/gradle.properties index aa77f06..d3806c7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,3 +11,6 @@ kaleido_config_version=0.3.1+1.3.2 mod_version = 1.0.5+mc1.21.1 maven_group = io.ix0rai archives_base_name = ramel + +pub.should_publish = true +pub.additional_versions = 1.21 \ No newline at end of file