#Getting Started

ModPublisher is a Gradle Plugin that allows modders to publish their mods to Modrinth, Curseforge and GitHub in one go.

No need for separate plugins, just one!


#Installing the Plugin

To use this plugin inside your project, first you have to add our maven.

To does this, open up settings.gradle and add the following:

pluginManagement { repositories { gradlePluginPortal() maven { url "https://maven.firstdark.dev/releases" } } }
1
2
3
4
5
6
7
8

Next, in your build.gradle add:

plugins { id "com.hypherionmc.modutils.modpublisher" version "VERSION" }
1
2
3

Replace VERSION with the version above.


#Basic Setup

Add this into your build.gradle file:

publisher { // Setup the required API keys. You only need to define the keys for // the platforms you plan on uploading to apiKeys { // Modrinth Token modrinth System.getenv("MODRINTH_TOKEN") // Curseforge Token curseforge System.getenv("CURSE_TOKEN") // GitHub Token github System.getenv("GITHUB_TOKEN") } // Enable Debug mode. When enabled, no files will actually be uploaded setDebug(true) // Curseforge Project ID setCurseID("1234") // Modrinth Project ID setModrinthID("dsgfhs79789") // Type of release. beta, alpha or release setVersionType("beta") // Changelog. This can be a file, string, OR, gist/github url // For example: markdown.md, or "This is my changelog" // Or: https://raw.githubusercontent.com/hypherionmc/changelogs/changelog.md // Or https://gist.githubusercontent.com/hypherionmc/92f825d3c9337964cc77c9c8c9bf65e6/raw/ceeaaee5b98c688a23398864fe480b84796a1651/test_gist.md setChangelog("changelog.md") // Required for Modrinth/GitHub setVersion("1.20.2-${project.version}") // Fancy display name for the upload. // Will default to the project version if not set setDisplayName("[1.20.x] Simple Discord Link - ${project.version}") // The supported game versions setGameVersions("1.20", "1.20.1", "1.20.2") // The modloaders your upload supports. // This can also be an Enum from ModLoader, // like setLoaders(ModLoader.FABRIC, ModLoader.FORGE) setLoaders("forge", "fabric") // The new Curseforge Environment tag. Optional // Valid values are "server", "client" or "both" // You can also use CurseEnvironment.BOTH, or CurseEnvironment.SERVER or CurseEnvironment.CLIENT setCurseEnvironment("both") // The file to be uploaded. This can be a file, task, or string. // setArtifact("build/libs/mymod.jar") // setArtifact(jar.getArchiveFile().get()) // If this is a task, the task specified will be executed before publishing setArtifact(jar) // Override the artifact uploaded to modrinth // setPlatformArtifact(Platform.Modrinth, "build/libs/mymod.jar") // setPlatformArtifact(Platform.Modrinth, jar.getArchiveFile().get()) // If this is a task, the task specified will be executed before publishing // Valid platforms are modrinth, curseforge and github setPlatformArtifact("modrinth", modrinthJar) // Disable the built in Fractureizer scanner setDisableMalwareScanner(true) // Add supported java versions. Currently only used by CurseForge setJavaVersions("Java 8", "Java 11") // Safety check to check if the artifact contains a valid mod metadata entry, // which could possibly mean that the jar is empty setDisableEmptyJarCheck(true) // Additional files to upload. Same as artifact, this can be a task, file or string addAdditionalFile(jar, secondJar) // Additional files to upload with a custom display name and changelog. // Currently only supported on Curseforge addAdditionalFile { // File, Task or String artifact jar displayName "Some Name" changelog "Hello Changelog" } }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

Modrinth/Curseforge Dependencies
dependencies/