1
1
plugins {
2
2
id ' ferritecore.subproject-conventions'
3
+ id " me.modmuss50.mod-publish-plugin"
3
4
}
4
5
5
6
String makeVersionSuffix () {
@@ -10,7 +11,8 @@ String makeVersionSuffix() {
10
11
}
11
12
}
12
13
13
- archivesBaseName = " ${ mod_id} -${ mod_version}${ makeVersionSuffix()} -" + project. name. toLowerCase()
14
+ def full_version = " ${ mod_version}${ makeVersionSuffix()} " ;
15
+ archivesBaseName = " ${ mod_id} -${ full_version} -" + project. name. toLowerCase(Locale . ROOT )
14
16
15
17
jar {
16
18
manifest {
30
32
task signJar (description : " Sign jar" ) {
31
33
doLast {
32
34
if (project. hasProperty(' keyStore' )) {
33
- def path;
34
- if (project. name == " NeoForge" ) {
35
- path = jar. archivePath
36
- } else {
37
- path = remapJar. archivePath
38
- }
39
- logger. warn(" Signing " + path + " \n " )
40
- ant. signjar(jar : path,
35
+ logger. warn(" Signing " + jar. archivePath + " \n " )
36
+ ant. signjar(jar : jar. archivePath,
41
37
alias : project. storeAlias,
42
38
keystore : project. keyStore,
43
39
storepass : project. storePass,
@@ -50,6 +46,7 @@ task signJar(description: "Sign jar") {
50
46
}
51
47
52
48
build. finalizedBy signJar
49
+ signJar. dependsOn build
53
50
54
51
compileJava. doFirst {
55
52
// This is set by Mixin during annotation processing, but should not persist between subprobjects
@@ -97,3 +94,30 @@ tasks.withType(Task) {
97
94
it. standardInput = System . in
98
95
}
99
96
}
97
+
98
+ def changelogFile = new File (" changelog/${ mod_version} .md" );
99
+
100
+ if (changelogFile. exists()) {
101
+ publishMods {
102
+ file = jar. archivePath
103
+ changelog = changelogFile. text
104
+ type = STABLE
105
+ modLoaders. add(name. toLowerCase(Locale . ROOT ))
106
+ displayName = archivesBaseName
107
+ version = " ${ full_version} -${ name.toLowerCase(Locale.ROOT)} "
108
+
109
+ curseforge {
110
+ accessToken = providers. gradleProperty(" CURSEFORGE_API_KEY" ). orElse(" invalid-key-dry-run" )
111
+ projectId = project. name == " Fabric" ? " 459857" : " 429235"
112
+ minecraftVersions. add(minecraft_version)
113
+ }
114
+ modrinth {
115
+ accessToken = providers. gradleProperty(" MODRINTH_API_KEY" ). orElse(' invalid-key-dry-run' )
116
+ projectId = " uXXizFIs"
117
+ minecraftVersions. add(minecraft_version)
118
+ }
119
+ }
120
+
121
+ tasks. getByName(" publishCurseforge" ). dependsOn signJar
122
+ tasks. getByName(" publishModrinth" ). dependsOn signJar
123
+ }
0 commit comments