Skip to content

Commit

Permalink
Added publishModrinth task using Minotaur
Browse files Browse the repository at this point in the history
  • Loading branch information
emonadeo committed Jul 20, 2021
1 parent 0831a32 commit 7496c49
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
plugins {
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id "fabric-loom" version "0.8-SNAPSHOT"
id "maven-publish"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "1.2.1"
}

sourceCompatibility = JavaVersion.VERSION_16
Expand All @@ -13,7 +14,7 @@ group = project.maven_group

repositories {
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/"}
maven { url "https://maven.terraformersmc.com/" }
}

dependencies {
Expand Down Expand Up @@ -62,7 +63,7 @@ java {

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
rename { "${it}_${project.archivesBaseName}" }
}
}

Expand Down Expand Up @@ -90,25 +91,21 @@ publishing {
}

curseforge {
if (project.hasProperty('curseForgeApiKey') || System.getenv('curseForgeApiKey') != null) {
apiKey = project.hasProperty('curseForgeApiKey') ? project.property('curseForgeApiKey') : System.getenv('curseForgeApiKey')
if (project.hasProperty("curseForgeApiKey") || System.getenv("curseForgeApiKey") != null) {
apiKey = project.hasProperty("curseForgeApiKey") ? project.property("curseForgeApiKey") : System.getenv("curseForgeApiKey")
project {
id = project.project_id
releaseType = project.release_type
changelogType = "text"
changelog = file("changelog.txt")

addGameVersion '1.16'
addGameVersion '1.16.1'
addGameVersion '1.16.2'
addGameVersion '1.16.3'
addGameVersion '1.16.4'
addGameVersion '1.16.5'
addGameVersion 'Java 8'
addGameVersion 'Fabric'
addGameVersion "1.17"
addGameVersion "1.17.1"
addGameVersion "Java 16"
addGameVersion "Fabric"

relations {
requiredLibrary 'fabric-api'
requiredLibrary "fabric-api"
}

mainArtifact(remapJar)
Expand All @@ -121,3 +118,16 @@ curseforge {
}
}
}

import com.modrinth.minotaur.TaskModrinthUpload

task publishModrinth (type: TaskModrinthUpload) {
token = project.hasProperty("modrinthApiKey") ? project.property("modrinthApiKey") : System.getenv("modrinthApiKey")
projectId = "2i7tg1Wv"
versionName = "v${project.mod_version} (Minecraft 1.17)"
versionNumber = version
uploadFile = remapJar
addGameVersion "1.17"
addGameVersion "1.17.1"
addLoader "fabric"
}

0 comments on commit 7496c49

Please sign in to comment.