Skip to content

Commit

Permalink
add curseforge publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Nov 20, 2021
1 parent 204a05d commit d585d60
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
27 changes: 27 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ plugins {
id "org.inferred.processors" version "3.3.0"
id "com.github.johnrengelman.shadow" version "6.0.0"
id "com.modrinth.minotaur" version "1.1.0"
id "com.matthewprenger.cursegradle" version "1.4.0"
}

def ENV = System.getenv()
Expand Down Expand Up @@ -300,6 +301,29 @@ publishing {
}
}

curseforge {
apiKey = ENV.CURSEFORGE_TOKEN ?: "invalid"
project {
id = project.curseforge_id
releaseType = isPreviewBuild ? ((ENV.TAG && ENV.TAG.contains("-beta")) ? "beta" : "alpha") : "release"
"${project.curseforge_game_versions}".split(",").each {
addGameVersion(it)
}

mainArtifact(remapJar) {
displayName = "${archivesBaseName} ${ENV.TAG ?: version}"
relations {
requiredDependency 'fabric-api'
embeddedLibrary 'cloth-config'
}
}
}

options {
forgeGradleIntegration = false
}
}

task publishToModrinth(type: TaskModrinthUpload, dependsOn: assemble) {
if (ENV.MODRINTH_TOKEN) {
token = ENV.MODRINTH_TOKEN
Expand All @@ -318,6 +342,9 @@ task publishToModrinth(type: TaskModrinthUpload, dependsOn: assemble) {
if (ENV.MODRINTH_TOKEN) {
tasks.publish.dependsOn(publishToModrinth)
}
if (ENV.CURSEFORGE_TOKEN) {
tasks.publish.dependsOn(tasks.curseforge)
}


test {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ requiem_version=2.0.0-alpha.12
#runtime dependencies
#test mods
# publishing
curseforge_id=320211
modrinth_id=XYIJ4l2k
modrinth_game_versions=1.17.1
curseforge_game_versions=1.17.1

0 comments on commit d585d60

Please sign in to comment.