Move to custom curse forge publish plugin

This commit is contained in:
modmuss50 2023-07-19 10:09:06 +01:00
parent 4d61bb4481
commit e6fc735bea
4 changed files with 33 additions and 52 deletions

View file

@ -27,7 +27,7 @@ jobs:
with:
context: changelog
workflow_id: release.yml
- run: ./gradlew checkVersion build publish curseforge github --stacktrace -x test
- run: ./gradlew checkVersion build publish publishMods github --stacktrace -x test
env:
RELEASE_CHANNEL: ${{ github.event.inputs.channel }}
MAVEN_URL: ${{ secrets.MAVEN_URL }}

View file

@ -1,37 +1,9 @@
apply plugin: "com.matthewprenger.cursegradle"
group = 'RebornCore'
loom {
accessWidenerPath = file("src/main/resources/reborncore.accesswidener")
}
def ENV = System.getenv()
curseforge {
if (ENV.CURSEFORGE_API_KEY) {
apiKey = ENV.CURSEFORGE_API_KEY
}
project {
id = "237903"
changelog = ENV.CHANGELOG ?: "No changelog provided"
releaseType = ENV.RELEASE_CHANNEL ?: "release"
addGameVersion "1.20.1"
addGameVersion "Fabric"
mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"))
afterEvaluate {
uploadTask.dependsOn("remapJar")
}
}
options {
forgeGradleIntegration = false
}
}
def rcAw = file("src/main/resources/reborncore.accesswidener")
def trAw = rootProject.file("src/main/resources/techreborn.accesswidener")

View file

@ -13,7 +13,7 @@ plugins {
id 'maven-publish'
id 'com.diffplug.spotless' version '6.19.0'
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'me.modmuss50.mod-publish-plugin' version '0.0.1'
}
repositories {
@ -339,31 +339,40 @@ tasks.register('copyTranslationsToGenerated', Copy) {
into file('src/main/generated')
}
curseforge {
if (ENV.CURSEFORGE_API_KEY) {
apiKey = ENV.CURSEFORGE_API_KEY
}
publishMods {
changelog = ENV.CHANGELOG ?: "No changelog provided"
version = project.version
type = ENV.RELEASE_CHANNEL == "release" ? STABLE : BETA
modLoaders.add("fabric")
dryRun = ENV.CURSEFORGE_API_KEY == null
project {
id = "233564"
changelog = ENV.CHANGELOG ?: "No changelog provided"
releaseType = ENV.RELEASE_CHANNEL ?: "release"
addGameVersion "1.20.1" // Also update in RebornCore/build.gradle
addGameVersion "Fabric"
def options = curseforgeOptions {
accessToken = providers.environmentVariable("CURSEFORGE_API_KEY")
minecraftVersions.add("1.20.1")
mainArtifact remapJar
relations {
requiredDependency 'reborncore'
}
requires {
slug = "fabric-api"
}
}
afterEvaluate {
uploadTask.dependsOn("remapJar")
}
}
curseforge("curseforgeTechReborn") {
from options
projectId = "233564"
file = remapJar.archiveFile
options {
forgeGradleIntegration = false
}
requires {
slug = "reborncore"
}
optional {
slug = "roughly-enough-items"
}
}
curseforge("curseforgeRebornCore") {
from options
projectId = "237903"
file = project(":RebornCore").tasks.remapJar.archiveFile
}
}
static def getBranch() {

View file

@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2G
fabric.loom.multiProjectOptimisation=true
# Mod properties
mod_version=5.8.3
mod_version=5.8.4
# Fabric Properties
# check these on https://modmuss50.me/fabric.html