Skip to content

Commit de2e732

Browse files
committed
new: Add Modrinth Publish Task
1 parent 9b1cda5 commit de2e732

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import com.modrinth.minotaur.TaskModrinthUpload
2+
13
plugins {
24
id 'fabric-loom' version '0.10-SNAPSHOT'
35
id 'maven-publish'
6+
id "com.modrinth.minotaur" version "1.2.1"
47
}
58

69
sourceCompatibility = JavaVersion.VERSION_17
@@ -85,3 +88,18 @@ publishing {
8588
// mavenLocal()
8689
}
8790
}
91+
92+
task publishModrinth (type: TaskModrinthUpload){ // Make sure it runs after build!
93+
onlyIf {
94+
System.getenv("MODRINTH_API") // Only attempt to run this task if the MODRINTH variable is set, otherwise SKIP it
95+
}
96+
97+
token = System.getenv("MODRINTH_API") // An environment property called MODRINTH that is your token, set via Gradle CLI, GitHub Actions, Idea Run Configuration, or other
98+
projectId = 'PtjYWJkn'
99+
versionName = "Sodium Extra ${project.mod_version} for Minecraft ${project.minecraft_version}"
100+
versionNumber = "mc${project.minecraft_version}-${project.mod_version}" // Will fail if Modrinth has this version already
101+
// On fabric, use 'remapJar' instead of 'jar'
102+
uploadFile = remapJar // This is the java jar task. If it can't find the jar, try 'jar.outputs.getFiles().asPath' in place of 'jar'
103+
addGameVersion("${project.minecraft_version}") // Call this multiple times to add multiple game versions. There are tools that can help you generate the list of versions
104+
addLoader('fabric')
105+
}

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ org.gradle.jvmargs=-Xmx1G
77
loader_version=0.12.6
88

99
# Mod Properties
10-
mod_version=0.3.6
10+
mod_version=0.3.7
1111
maven_group=me.flashyreese.mods
1212
archives_base_name=sodium-extra
1313

1414
# Dependencies
15-
reeses_sodium_options=mc1.18-1.2.4
16-
sodium_version=mc1.18-0.4.0-alpha1
15+
reeses_sodium_options=mc1.18-1.2.3
16+
sodium_version=mc1.18-0.4.0-alpha5
1717
fabric_version=0.43.1+1.18

0 commit comments

Comments
 (0)