@@ -94,7 +94,6 @@ dependencies {
94
94
implementation " libs:rgp_client:1.0.6"
95
95
}
96
96
97
- implementation " dev.ftb.mods:ftb-library-neoforge:2101.1.8"
98
97
implementation " curse.maven:fancymenu-367706:5823966"
99
98
100
99
// Deps
@@ -146,27 +145,88 @@ idea {
146
145
}
147
146
}
148
147
149
- // publishMods {
150
- // dryRun = providers.environmentVariable("CURSEFORGE_KEY").getOrNull() == null
151
- // changelog = createChangelog(project)
152
- // version = "${mod_version}"
153
- // file = project.provider { project(":$projectName").tasks.remapJar }.flatMap { it.archiveFile }
154
- //
155
- // // TODO: Migrate to something else
156
- // def tag = providers.environmentVariable("TAG").getOrElse("release")
157
- // type = STABLE
158
- //
159
- // curseforge {
160
- // displayName = "[${projectName.toUpperCase()}][${minecraft_version}] ${readable_name} ${mod_version}"
161
- // modLoaders.add("neoforge")
162
- //
163
- // accessToken = providers.environmentVariable("CURSEFORGE_KEY")
164
- // minecraftVersions.add("${minecraft_version}")
165
- //
166
- // projectId = curseforge_id_forge
167
- // requires('architectury-api')
168
- // requires('ftb-library-forge')
169
- // requires('ftb-teams-forge')
170
- // optional('ftb-xmod-compat')
171
- // }
172
- // }
148
+ def createChangelog () {
149
+ def commitHistory = file(" COMMIT_HISTORY" )
150
+ if (! commitHistory. exists()) {
151
+ return " "
152
+ }
153
+
154
+ def line = commitHistory. readLines()
155
+ Map<String , List<String > > changes = [
156
+ " added" : [],
157
+ " fixed" : [],
158
+ " changed" : [],
159
+ " removed" : [],
160
+ ]
161
+
162
+ def reading = false
163
+ for (def commit : line) {
164
+ if (commit. startsWith(" Date:" )) {
165
+ reading = true
166
+ continue
167
+ }
168
+
169
+ if (commit. startsWith(" commit" )) {
170
+ reading = false
171
+ continue
172
+ }
173
+
174
+ if (! reading) {
175
+ continue
176
+ }
177
+
178
+ commit = commit. trim()
179
+ if (commit. empty) {
180
+ continue
181
+ }
182
+
183
+ if (commit. startsWith(" feat: " )) changes. get(" added" ) << commit. substring(6 )
184
+ if (commit. startsWith(" fix: " )) changes. get(" fixed" ) << commit. substring(5 )
185
+ if (commit. startsWith(" chore: " )) changes. get(" changed" ) << commit. substring(7 )
186
+ if (commit. startsWith(" refactor: " )) changes. get(" changed" ) << commit. substring(10 )
187
+ if (commit. startsWith(" removed: " )) changes. get(" removed" ) << commit. substring(9 )
188
+ }
189
+
190
+ def changelog = " "
191
+ def changesKeys = changes. keySet()
192
+ for (def key : changesKeys) {
193
+ def changeList = changes[key]
194
+ if (changeList. size() > 0 ) {
195
+ changelog + = " ### ${ key.capitalize()} \n\n "
196
+ for (def change : changeList) {
197
+ // Titlecase the change
198
+ change = change. substring(0 , 1 ). toUpperCase() + change. substring(1 )
199
+ changelog + = " - $change \n "
200
+ }
201
+ }
202
+
203
+ changelog + = " \n "
204
+ }
205
+
206
+ def output = changelog. trim()
207
+ if (output. empty) {
208
+ return " No changelog provided"
209
+ }
210
+
211
+ return output
212
+ }
213
+
214
+ publishMods {
215
+ dryRun = true
216
+ changelog = createChangelog()
217
+ file = jar. archiveFile
218
+ displayName = " [NEOFORGE] FTB Promoter ${ project.version} "
219
+ modLoaders. add(" neoforge" )
220
+
221
+ type = STABLE
222
+
223
+ curseforge {
224
+ accessToken = providers. environmentVariable(" CURSEFORGE_KEY" )
225
+ minecraftVersions. add(minecraft_version)
226
+
227
+ projectId = curseforge_id
228
+
229
+ optional(' fancymenu' )
230
+ optional(' bisecthosting-server-integration-menu-neoforge' )
231
+ }
232
+ }
0 commit comments