diff --git a/Fabric/build.gradle b/Fabric/build.gradle index dfaf40c64c..5d2c719bc3 100644 --- a/Fabric/build.gradle +++ b/Fabric/build.gradle @@ -8,31 +8,55 @@ architectury { fabric() } -// FIXME: update dependencies/versions before releasing 0.12 -pkSubproj { - pkPublish = true - curseforgeJar = remapJar.archiveFile - curseforgeDependencies([ - "paucal", - "patchouli", - "fabric-language-kotlin", - "inline", - "cloth-config", - "cardinal-components-api", - "fabric-api", - ]) - modrinthJar = remapJar.archiveFile - modrinthDependencies([ - "paucal:dabyDTwJ", // 0.6.0-fabric - "patchouli:1.20.1-80-fabric", - "fabric-language-kotlin:1.13.7+kotlin.2.2.21", - "inline:1.20.1-1.2.2-fabric", - "cloth-config:11.1.106+fabric", - "cardinal-components-api:5.2.1", - "fabric-api:0.84.0+1.20.1", - ]) -} +publishMods { + // for Fabric 1.21.11 and below + file = remapJar.archiveFile + modLoaders.add("fabric") + curseforge{ + requires( + "paucal", + "patchouli", + "fabric-language-kotlin", + "inline", + "cloth-config", + "cardinal-components-api", + "fabric-api", + ) + } + modrinth{ + requires { + slug = "paucal" + version = "6xwATRVY" // 0.7.0 fabric ver + } + requires { + slug = "patchouli" + version = "1.21-88-fabric" + } + requires { + slug = "fabric-language-kotlin" + version = fabricLanguageKotlinVersion + } + + requires { + slug = "inline" + version = "1.21.1-1.2.2-fabric" + } + + requires { + slug = "cloth-config" + version = clothConfigVersion + "+fabric" + } + requires { + slug = "cardinal-components-api" + version = cardinalComponentsVersion + } + requires { + slug = "fabric-api" + version = fabricVersion + } + } +} loom { mixin.defaultRefmapName = "hexcasting.mixins.refmap.json" diff --git a/Jenkinsfile b/Jenkinsfile index d876a02385..26b39f1a11 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,14 +1,29 @@ #!/usr/bin/env groovy +RELEASE_BRANCHES = ["main", "1.21"] + pipeline { agent any tools { jdk "jdk-21" } + parameters { + booleanParam( + name: "PUBLISH_CURSEFORGE_AND_MODRINTH", + description: "Publish to CurseForge and modrinth", + defaultValue: false, + ) + booleanParam( + name: "FORMAL_RELEASE", + description: "decides if is a formal release (without -pre)", + defaultValue: false, + ) + } environment { discordWebhook = credentials('discordWebhook') CURSEFORGE_TOKEN = credentials('curseforgeApiKey') MODRINTH_TOKEN = credentials('modrinthApiKey') + FORMAL_RELEASE = "${params.FORMAL_RELEASE ? 'true' : 'false'}" } stages { stage('Clean') { @@ -43,7 +58,7 @@ pipeline { stage('Publish') { when { allOf { - branch 'main' + expression { env.BRANCH_NAME in RELEASE_BRANCHES } not { changeRequest() } } } @@ -51,15 +66,18 @@ pipeline { stage('Deploy Previews') { steps { echo 'Deploying previews to various places' - sh './gradlew publish publishToDiscord' + sh './gradlew publish announceDiscord' } } stage('Deploy releases') { + when { + expression { params.CURSEFORGE_AND_MODRINTH} + } steps { echo 'Maybe deploy releases' sh './gradlew publishCurseforge publishModrinth' } - } + }} } } } diff --git a/Neoforge/build.gradle b/Neoforge/build.gradle index 1d2cb902ba..af3b660991 100644 --- a/Neoforge/build.gradle +++ b/Neoforge/build.gradle @@ -8,23 +8,36 @@ architectury { neoForge() } -// FIXME: update dependencies/versions before releasing 0.12 -pkSubproj { - pkPublish = true - curseforgeJar = jar.archiveFile - curseforgeDependencies([ - "paucal", - "patchouli", - "caelus", - "inline", - ]) - modrinthJar = jar.archiveFile - modrinthDependencies([ - "paucal:HyBiJPtT", // 0.6.0-forge - "patchouli:1.20.1-80-forge", - "caelus:3.1.0+1.20", - "inline:1.20.1-1.0.1-forge", - ]) +publishMods { + file = jar.archiveFile + modLoaders.add("neoForge") + curseforge{ + requires( + "paucal", + "patchouli", + "caelus", + "inline" + ) + } + modrinth{ + requires { + slug = "paucal" + version = "zgpdzVKd" + platform = "neoforge" + } + requires { + slug = "patchouli" + version = "1.21-88-neoforge" + } + requires { + slug = "caelus" + version = "KsfI4QsR" // 7.0.1+1.21.1 neoforge ver + } + requires { + slug = "inline" + version = "1.21.1-1.2.2-neoforge" + } + } } configurations { @@ -55,7 +68,7 @@ repositories { } maven { url = "https://maven.neoforged.net/releases/" } - // paucal and patchi + // paucal and patchouli maven { url = 'https://maven.blamejared.com' } maven { name = "Curios" diff --git a/build.gradle b/build.gradle index bf4ef690be..ea30979339 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,3 @@ -import at.petrak.pkpcpbp.MiscUtil - plugins { // used for something?? id 'dev.architectury.loom' version '1.13-SNAPSHOT' apply false @@ -14,63 +12,37 @@ plugins { // Also it looks like property lookups don't work this early id 'fabric-loom' version '1.9+' apply false - id("at.petra-k.pkpcpbp.PKPlugin") version "0.2.0-pre-104" - id("at.petra-k.pkpcpbp.PKSubprojPlugin") version "0.2.0-pre-104" apply false id("at.petra-k.pkpcpbp.PKJson5Plugin") version "0.2.0-pre-104" apply false + id "me.modmuss50.mod-publish-plugin" } architectury { minecraft = project.minecraftVersion } -pkpcpbp { - // if something goes wrong in CI, make sure we can see the logs to figure out why - superDebugInfo = System.getenv("CI") != null - // we set the maven coordinates manually in the subprojects block - doProjectMetadata = false - setupJarMetadata = true - setupMavenMetadata = true - javaVersion = 21 - modInfo { - modID = project.modID - mcVersion = project.minecraftVersion - modVersion = project.modVersion - } - curseforgeInfo { - id = 569849 - stability = "beta" - token = System.getenv("CURSEFORGE_TOKEN") - } - modrinthInfo { - id = "nTW3yKrm" - stability = "beta" - token = System.getenv("MODRINTH_TOKEN") - } -} - -subprojects { +subprojects { subproject -> apply plugin: 'dev.architectury.loom' apply plugin: 'architectury-plugin' apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'maven-publish' - apply plugin: 'at.petra-k.pkpcpbp.PKSubprojPlugin' apply plugin: 'at.petra-k.pkpcpbp.PKJson5Plugin' - + if(subproject.path != ":Common") { + apply plugin: 'me.modmuss50.mod-publish-plugin' + } group = "at.petra-k.$modID" base.archivesName = "$modID-$platform-$minecraftVersion" version = modVersion - def isRelease = MiscUtil.isRelease(MiscUtil.getMostRecentPush(project)) + def isRelease = System.getenv("FORMAL_RELEASE") ? + System.getenv("FORMAL_RELEASE").toBoolean() : false def buildNumber = System.getenv("BUILD_NUMBER") if (!isRelease && buildNumber != null) { version += "-pre-$buildNumber" } - pkSubproj { - platform = project.platform - artifactId = base.archivesName.get() - versionDisplayName = "$platform-$minecraftVersion-$modVersion" + kotlin { + jvmToolchain(21) } pkJson5 { @@ -132,6 +104,28 @@ subprojects { } } } + if(subproject.path != ":Common") { + publishMods { + type = BETA + changelog = "" + + modrinth { + accessToken = providers.environmentVariable("MODRINTH_TOKEN") + projectId = "nTW3yKrm" + minecraftVersions.add("1.21.1") + } + curseforge { + accessToken = providers.environmentVariable("CURSEFORGE_TOKEN") + projectId = "569849" + minecraftVersions.add("1.21.1") + client = true + server = true + } + discord { + webhookUrl = providers.environmentVariable("discordWebhook") + } + } + } } allprojects { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ca025c83a7..4f5eb9dcc0 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.14-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle index 6f0bfae898..84b7b6fa80 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,6 +15,7 @@ pluginManagement { plugins { id "org.jetbrains.kotlin.jvm" version kotlinVersion + id "me.modmuss50.mod-publish-plugin" version "2.1.1" } }