Skip to content

Commit 5f2fd11

Browse files
committed
added publish mods plugin
1 parent 58ca436 commit 5f2fd11

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

build.gradle

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import me.modmuss50.mpp.ReleaseType
2+
13
plugins {
24
id 'java-library'
35
id 'maven-publish'
46
id 'net.neoforged.moddev' version '2.0.99'
57
id 'idea'
8+
id "me.modmuss50.mod-publish-plugin" version "0.8.4"
69
}
710

811
//tasks.named('wrapper', Wrapper).configure {
@@ -124,6 +127,7 @@ var generateModMetadata = tasks.register("generateModMetadata", ProcessResources
124127
mod_license : mod_license,
125128
mod_version : mod_version,
126129
mod_authors : mod_authors,
130+
mod_credits : mod_credits,
127131
mod_description : mod_description
128132
]
129133
inputs.properties replaceProperties
@@ -147,6 +151,36 @@ publishing {
147151
}
148152
}
149153

154+
def changelogFile = file("build/changelog.txt")
155+
156+
publishMods {
157+
file = jar.archiveFile
158+
displayName = "${mod_name.replace(' ','')}-NeoForge-${minecraft_version} ${project.version}"
159+
if (changelogFile.exists()) {
160+
changelog.set(changelogFile.getText())
161+
}
162+
type = ReleaseType.of(versionType.toUpperCase())
163+
modLoaders.add("neoforge")
164+
165+
curseforge {
166+
projectId = "1157051"
167+
projectSlug = "dynamic-trees-regions-unexplored" // Required for discord webhook
168+
accessToken = curseApiKey ?: System.getenv("CURSEFORGE_API_KEY")
169+
minecraftVersions.add("1.21.1")
170+
requires("dynamictrees")
171+
requires("regions-unexplored")
172+
optional("dynamictreesplus")
173+
}
174+
modrinth {
175+
projectId = "IOcN8dvy"
176+
accessToken = modrinthToken ?: System.getenv("MODRINTH_TOKEN")
177+
minecraftVersions.add("1.21.1")
178+
requires("vdjF5PL5") //dt
179+
requires("Tkikq67H") //ru
180+
optional("qaO9Dqpu") //dt+
181+
}
182+
}
183+
150184
tasks.withType(JavaCompile).configureEach {
151185
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
152186
}

gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ loader_version_range=[1,)
2727
mod_id=dtru
2828
mod_name=DT_RegionsUnexplored
2929
mod_license=All Rights Reserved
30-
mod_version=1.0.0
30+
mod_version=1.1.0-BETA01
3131
mod_group_id=dtteam.dtru
3232
mod_authors= DviousDingle, Vimhax
33+
mod_credits= metafive, Yuneth Alwis
3334
mod_description= A 1.21.1 Neoforge Port for Dynamic Trees Regions Unexplored
35+
36+
versionType=beta

src/main/templates/META-INF/neoforge.mods.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ displayName="Dynamic Trees for Regions Unexplored" #mandatory
3939
#logoFile="examplemod.png" #optional
4040

4141
# A text field displayed in the mod UI
42-
#credits="" #optional
42+
credits="${mod_credits}" #optional
4343

4444
# A text field displayed in the mod UI
4545
authors="${mod_authors}" #optional

0 commit comments

Comments
 (0)