Automate Curseforge Upload

This commit is contained in:
Frank 2022-11-16 16:00:25 +01:00
parent 172737e0fa
commit 1cd070dbfb
2 changed files with 40 additions and 1 deletions

View file

@ -4,6 +4,7 @@ plugins {
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
id "com.matthewprenger.cursegradle" version "1.4.0"
}
apply from: "bclib.gradle"
@ -99,4 +100,41 @@ modrinth {
required.project "fabric-api"
}
debugMode = false
}
curseforge {
def slurper = new groovy.json.JsonSlurper()
apiKey = new File(projectDir, "../CURSEFORGE_TOKEN")
if (apiKey.exists()) {
apiKey = apiKey.text
} else {
apiKey = ""
}
def changes = new File(projectDir, "CHANGES.md")
if (changes.exists()) {
changes = changes.getText('UTF-8')
} else {
changes = ""
}
project {
id = '495191'
changelogType = 'markdown'
changelog = changes
releaseType = project.release_channel
for (item in slurper.parseText(project.modrinth_versions)) {
addGameVersion item
}
mainArtifact(jar) {
displayName = "$project.archives_base_name-$project.version [1.19.2]"
relations {
requiredDependency 'fabric-api'
}
}
}
options {
debug = false
}
}

View file

@ -2,7 +2,8 @@
org.gradle.jvmargs=-Xmx8G
#Modrinth
modrinth_versions=["1.19", "1.19.1", "1.19.2"]
release_channel=release #`release`, `beta` or `alpha`
#`release`, `beta` or `alpha`
release_channel=release
#Loom
loom_version=0.12-SNAPSHOT
# Fabric Properties