From ca52dec084a4a0d58f3b5cd54acce804e319352c Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Wed, 17 Jan 2024 11:00:25 +0000 Subject: [PATCH] build updates gradle -> 8.5 switch to MPP for CF/modrinth publishing --- Changelog.md | 6 ++ build.gradle | 75 +++++++++++++----------- gradle.properties | 3 +- gradle/wrapper/gradle-wrapper.properties | 2 +- release_info.json | 7 ++- 5 files changed, 55 insertions(+), 38 deletions(-) diff --git a/Changelog.md b/Changelog.md index 01931dc6..c95065ca 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,6 +10,12 @@ Changes are in reverse chronological order; newest changes at the top. * Added a new smart filter: the Tag Filter! * Can be used to select [item tags](https://minecraft.fandom.com/wiki/Tag) which can be filtered against + * More precise than just enabling the tag mode option in the module GUI +* Fixed NPE when saving Template blocks (as extruded by the Extruder Mk2) +* Volume of the "bleep" sound when setting up modules is now quieter by default + * Volume can also be configured in client config; see `bleepVolume` in `modularrouters-client.toml` +* Fixed a couple of GUI spots where text was being wrongly rendered with a drop shadow +* Cleaned up mod's handling of NBT on module items; modules now have no NBT until configured ### [12.0.2] diff --git a/build.gradle b/build.gradle index 6f5cce6a..f98ef529 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,4 @@ +import me.modmuss50.mpp.ReleaseType buildscript { // repositories { @@ -14,8 +15,7 @@ plugins { id("java") id("eclipse") id("idea") - id("com.modrinth.minotaur") version "2.+" - id('com.matthewprenger.cursegradle') version "1.4.0" + id "me.modmuss50.mod-publish-plugin" version "0.4.5" id('net.neoforged.gradle') version '[6.0.13, 6.2)' id('maven-publish') } @@ -23,9 +23,9 @@ apply plugin: 'org.parchmentmc.librarian.forgegradle' java.toolchain.languageVersion = JavaLanguageVersion.of(17) -version = "${mod_version}+mc${project.mc_version}" +version = "${mod_version}+mc${mc_version}" group = "me.desht.modularrouters" -archivesBaseName = modid +archivesBaseName = "${modid}" ext.releaseTag = System.getenv('TAG') ?: "" ext.isAlpha = ext.releaseTag.contains("alpha") @@ -33,7 +33,6 @@ ext.isBeta = ext.releaseTag.contains("beta") def semver = mod_version def relType = ext.isAlpha ? "alpha" : (ext.isBeta ? "beta" : "release") -//version += System.getenv("BUILD_NUMBER") ?: "-CUSTOM" sourceSets.main.resources { srcDir 'src/generated/resources' @@ -210,40 +209,50 @@ publishing { } } -modrinth { - token = System.getenv("MODRINTH_TOKEN") - projectId = "${project.modrinth_project_id}" - versionNumber = version.toString() - versionType = relType - uploadFile = jar // With Loom, this MUST be set to `remapJar` instead of `jar`! - gameVersions = [ mc_version ] // Must be an array, even with only one version - changelog = System.getenv("CHANGELOG") - dependencies { // A special DSL for creating dependencies - // scope.type - // The scope can be `required`, `optional`, or `incompatible` - // The type can either be `project` or `version` - optional.project "nU0bVIaL" // Patchouli +Closure getReleaseType = { type -> + switch(type) { + case "alpha": return ReleaseType.ALPHA + case "beta": return ReleaseType.BETA + default: return ReleaseType.STABLE } } -if (System.getenv("CURSEFORGE_TOKEN")) { +publishMods { + dryRun = providers.environmentVariable("CURSEFORGE_TOKEN").getOrNull() == null + changelog = providers.environmentVariable("CHANGELOG").orElse("dryrun") + version = mod_version + type = getReleaseType(relType) + file = jar.archiveFile + displayName = "${mod_name} ${mod_version} MC-${mc_version}" + modLoaders.add("forge") + modLoaders.add("neoforge") + curseforge { - apiKey = System.getenv("CURSEFORGE_TOKEN") - project { - id = project.curse_project_id - changelogType = "markdown" - changelog = System.getenv("CHANGELOG") - releaseType = relType - addGameVersion project.mc_version - addGameVersion "Forge" - mainArtifact(jar.archiveFile) { - displayName = "${project.archivesBaseName} v${project.mc_version}-${semver}" - relations { - optionalDependency "patchouli" - } - } + projectId = curse_project_id + accessToken = providers.environmentVariable("CURSEFORGE_TOKEN") + minecraftVersions.add(mc_version) + projectSlug = "modular-routers" + announcementTitle = "Download from Curseforge" + optional { + slug = "patchouli" + } + } + + modrinth { + projectId = modrinth_project_id + accessToken = providers.environmentVariable("MODRINTH_TOKEN") + minecraftVersions.add(mc_version) + announcementTitle = "Download from Modrinth" + requires { + id = "nU0bVIaL" } } + + discord { + webhookUrl = providers.environmentVariable("DISCORD_WEBHOOK").orElse("dryrun") + content = changelog.map { "# A new version of Modular Routers has been released! \n" + it} +// setPlatforms(platforms.curseforge, platforms.modrinth) + } } idea { diff --git a/gradle.properties b/gradle.properties index b0459234..4df5b540 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,8 @@ org.gradle.daemon=false # Mod modid=modular-routers -mod_version=12.0.2 +mod_name="Modular Routers" +mod_version=12.1.0 modrinth_project_id=EuTS81Z3 curse_project_id=250294 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d3..3499ded5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/release_info.json b/release_info.json index 21ba6ed8..8cab02ba 100644 --- a/release_info.json +++ b/release_info.json @@ -1,12 +1,13 @@ { "homepage" : "https://minecraft.curseforge.com/projects/modular-routers", "promos" : { - "1.20.1-recommended" : "12.0.2", - "1.20.1-latest" : "12.0.2" + "1.20.1-recommended" : "12.1.0", + "1.20.1-latest" : "12.1.0" }, "1.20.1" : { "12.0.0": "https://github.com/desht/ModularRouters/blob/MC1.20.1-master/Changelog.md#1200", "12.0.1": "https://github.com/desht/ModularRouters/blob/MC1.20.1-master/Changelog.md#1201", - "12.0.2": "https://github.com/desht/ModularRouters/blob/MC1.20.1-master/Changelog.md#1202" + "12.0.2": "https://github.com/desht/ModularRouters/blob/MC1.20.1-master/Changelog.md#1202", + "12.1.0": "https://github.com/desht/ModularRouters/blob/MC1.20.1-master/Changelog.md#1210" } }