Skip to content

Commit

Permalink
build updates
Browse files Browse the repository at this point in the history
 gradle -> 8.5
 switch to MPP for CF/modrinth publishing
  • Loading branch information
desht committed Jan 17, 2024
1 parent 5c62c59 commit ca52dec
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 38 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
75 changes: 42 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import me.modmuss50.mpp.ReleaseType

buildscript {
// repositories {
Expand All @@ -14,26 +15,24 @@ 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')
}
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")
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'
Expand Down Expand Up @@ -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<ReleaseType> 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 {
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
7 changes: 4 additions & 3 deletions release_info.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit ca52dec

Please sign in to comment.