Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,13 @@ jobs:
MI_VERSION: ${{ github.event.release.tag_name }}
MODMAVEN_USER: ${{ secrets.MODMAVEN_USER }}
MODMAVEN_PASSWORD: ${{ secrets.MODMAVEN_PASSWORD }}
- name: Upload to Curseforge
- name: Upload to Curseforge and Modrinth
env:
MI_VERSION: ${{ github.event.release.tag_name }}
CHANGELOG: ${{ github.event.release.body }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
run: ./gradlew curseforge405388
- name: Upload to Modrinth
env:
MI_VERSION: ${{ github.event.release.tag_name }}
CHANGELOG: ${{ github.event.release.body }}
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
run: ./gradlew modrinth
run: ./gradlew publishMods
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
94 changes: 34 additions & 60 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.72'
id 'net.neoforged.moddev' version '2.0.112'
id 'com.diffplug.spotless' version '6.25.0'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id "com.modrinth.minotaur" version "2.+"
id 'me.modmuss50.mod-publish-plugin' version '1.0.0'
}

version = System.getenv("MI_VERSION")
Expand All @@ -19,9 +18,6 @@ base {

logger.lifecycle("Modern Industrialization version ${version}")

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
Expand Down Expand Up @@ -346,69 +342,47 @@ spotless {
}
}

def releaseChannel = "release"
def changelog = System.getenv("CHANGELOG") ?: "Please visit our github repository for a changelog: https://github.com/AztechMC/Modern-Industrialization/releases."
def releaseChannel = "stable"
def changelogContents = System.getenv("CHANGELOG") ?: "Please visit our github repository for a changelog: https://github.com/AztechMC/Modern-Industrialization/releases."
if (version.toLowerCase().contains("alpha")) {
releaseChannel = "alpha"
changelog = "THIS IS AN ALPHA RELEASE, MAKE A BACKUP BEFORE INSTALLING AND FREQUENTLY WHILE PLAYING, AND PLEASE REPORT ANY ISSUE YOU MAY FIND ON OUR ISSUE TRACKER.\n\n" + changelog
changelogContents = "THIS IS AN ALPHA RELEASE, MAKE A BACKUP BEFORE INSTALLING AND FREQUENTLY WHILE PLAYING, AND PLEASE REPORT ANY ISSUE YOU MAY FIND ON OUR ISSUE TRACKER.\n\n" + changelogContents
} else if (version.toLowerCase().contains("beta")) {
releaseChannel = "beta"
changelog = "This is a beta release. It is expected to be mostly stable, but in any case please report any issue you may find.\n\n" + changelog
changelogContents = "This is a beta release. It is expected to be mostly stable, but in any case please report any issue you may find.\n\n" + changelogContents
}

// Publishing
if (System.getenv("CURSEFORGE_API_KEY") && !version.endsWith("-SNAPSHOT")) {
import me.modmuss50.mpp.ReleaseType

publishMods {
file = tasks.named("jar").flatMap { it.archiveFile }
version = project.version
changelog = changelogContents
type = ReleaseType.of(releaseChannel)
displayName = "Modern Industrialization v${version}"
modLoaders = ["neoforge"]

def shared = { platform ->
platform.minecraftVersions.add project.minecraft_version

platform.requires "guideme"
platform.optional "jade", "emi", "jei"
}

curseforge {
apiKey = System.getenv().get("CURSEFORGE_API_KEY")
project {
id = project.curseforge_project
releaseType = releaseChannel
changelogType = "markdown"
delegate.changelog = changelog

addGameVersion project.minecraft_version
addGameVersion "NeoForge"
addGameVersion "Java 21"

relations {
requiredDependency "guideme"
optionalDependency "wthit"
optionalDependency "emi"
optionalDependency "jei"
optionalDependency "roughly-enough-items"
embeddedLibrary "grandpower"
}
mainArtifact(tasks.named("jar").flatMap { it.archiveFile }) {
displayName = "Modern Industrialization v${version}"
}
}
options {
forgeGradleIntegration = false
}
afterEvaluate {
tasks.getByName("curseforge${project.curseforge_project}").dependsOn tasks.jar
}
projectId = project.curseforge_project
accessToken = providers.environmentVariable("CURSEFORGE_API_KEY")
javaVersions.add JavaVersion.VERSION_21
shared it
embeds "grandpower"
optional "roughly-enough-items"
}
}

modrinth {
token = System.getenv("MODRINTH_API_KEY")
projectId = project.modrinth_project
versionNumber = version
versionName = "Modern Industrialization v${version}"
delegate.changelog = changelog
versionType = releaseChannel
uploadFile = tasks.jar
gameVersions = [project.minecraft_version]
loaders = ["neoforge"]
dependencies {
required.project "guideme"
optional.project "wthit"
optional.project "emi"
optional.project "jei"
optional.project "rei"
modrinth {
projectId = project.modrinth_project
accessToken = providers.environmentVariable("MODRINTH_API_KEY")
shared it
optional "rei"
}
}
tasks.modrinth.onlyIf {
System.getenv("MODRINTH_API_KEY") && !version.endsWith("-SNAPSHOT")
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ org.gradle.jvmargs=-Xmx2G \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
org.gradle.configuration-cache=true

# Core NeoForge properties
minecraft_version=1.21.1
Expand Down
2 changes: 2 additions & 0 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#This file is generated by updateDaemonJvm
toolchainVersion=21
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading