Skip to content

Commit

Permalink
Merge pull request #153 from FTBTeam/1.19/dev
Browse files Browse the repository at this point in the history
build: use MPP for publishing
  • Loading branch information
desht authored Aug 28, 2024
2 parents 0e70ebc + 98ccd9f commit 3b82dbf
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 5 deletions.
44 changes: 43 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id "me.modmuss50.mod-publish-plugin" version "0.5.1"
}

architectury {
Expand Down Expand Up @@ -90,4 +91,45 @@ allprojects {
}
}

task curseforgePublish
publishMods {
dryRun = providers.environmentVariable("CURSEFORGE_KEY").getOrNull() == null
changelog = providers.environmentVariable("CHANGELOG").getOrElse("No changelog provided")
version = "${mod_version}"

// TODO: Migrate to something else
def tag = providers.environmentVariable("TAG").getOrElse("release")
type = tag.endsWith("-beta") ? BETA : (tag.endsWith("-alpha") ? ALPHA : STABLE)

def createOptions = (String projectName) -> {
publishOptions {
file = project.provider { project(":$projectName").tasks.remapJar }.flatMap { it.archiveFile }
displayName = "[${projectName.toUpperCase()}][${minecraft_version}] ${readable_name} ${mod_version}"
modLoaders.add(projectName.toLowerCase())
}
}

def fabricOptions = createOptions("fabric")
def forgeOptions = createOptions("forge")

def curseForgeOptions = curseforgeOptions {
accessToken = providers.environmentVariable("CURSEFORGE_KEY")
minecraftVersions.add("${minecraft_version}")
}

curseforge("curseforgeFabric") {
from(curseForgeOptions, fabricOptions)
projectId = curseforge_id_fabric
requires("fabric-api")
requires("architectury-api")
requires('ftb-library-fabric')
optional('ftb-ranks-fabric')
}

curseforge("curseforgeForge") {
from(curseForgeOptions, forgeOptions)
projectId = curseforge_id_forge
requires {slug = "architectury-api" }
requires {slug = 'ftb-library-forge' }
optional {slug = 'ftb-ranks-forge' }
}
}
2 changes: 0 additions & 2 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,3 @@ publishing {
}
}
}

rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")
2 changes: 0 additions & 2 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ publishing {
}
}

rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")

// Used to temporarily add mods to the workspace for debugging
def customGradle = project.file('custom.gradle')
if (customGradle.exists()) {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
mod_version=1902.4.2
readable_name=FTB Ultimine
maven_group=dev.ftb.mods
mod_id=ftbultimine
archives_base_name=ftb-ultimine
Expand Down

0 comments on commit 3b82dbf

Please sign in to comment.