Skip to content

Commit a6bdc9e

Browse files
committed
feat: add Modrinth integration and update publishing configuration in build.gradle; create jitpack.yml for JitPack support
1 parent 002a6dd commit a6bdc9e

2 files changed

Lines changed: 45 additions & 22 deletions

File tree

build.gradle

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -98,40 +98,62 @@ jar {
9898
}
9999
}
100100

101+
def writeModrinthBodyFile = { String text ->
102+
def outFile = file("${buildDir}/modrinth-description.md")
103+
outFile.parentFile.mkdirs()
104+
outFile.text = text
105+
return outFile
106+
}
107+
108+
modrinth {
109+
token = System.getenv("MODRINTH_TOKEN")
110+
projectId = "noctisui"
111+
versionNumber = version
112+
versionName = "NoctisUI ${version}"
113+
uploadFile = remapJar
114+
gameVersions = ["${minecraft_version}"]
115+
loaders = ["fabric"]
116+
117+
def modrinthBody = fetchReleaseDescription(tag)
118+
syncBodyFrom = writeModrinthBodyFile(modrinthBody)
119+
}
120+
121+
tasks.register('printModrinthBody') {
122+
group = 'help'
123+
description = 'Print the Modrinth description body chosen for this version (fetches GitHub release body or falls back to README.md) and show the file path'
124+
doLast {
125+
def body = fetchReleaseDescription(tag)
126+
def outFile = writeModrinthBodyFile(body)
127+
println "Modrinth description written to: ${outFile.absolutePath}"
128+
println '---- Modrinth description start ----'
129+
println body
130+
println '---- Modrinth description end ----'
131+
}
132+
}
133+
101134
publishing {
102135
publications {
103-
create("mavenJava", MavenPublication) {
104-
groupId = project.maven_group
105-
artifactId = project.archives_base_name
106-
version = project.version
107-
108-
artifact(tasks.named("jar")) {
109-
classifier = "dev"
110-
builtBy tasks.named("jar")
111-
}
112-
113-
artifact(tasks.named("sourcesJar")) {
114-
classifier = "sources"
115-
builtBy tasks.named("sourcesJar")
116-
}
136+
create("maven", MavenPublication) {
137+
from components.java
138+
artifactId = 'noctisui'
117139

118140
pom {
119141
name = 'NoctisUI'
120-
description = 'A Minecraft UI library for creating custom and interactive user interfaces'
142+
description = 'NoctisUI is a Minecraft UI library that makes it easy to create menus and HUDs.'
121143
url = 'https://github.com/AxenoDev/NoctisUI'
122144

123145
licenses {
124146
license {
125147
name = 'GNU General Public License v3.0'
126-
url = 'https://www.gnu.org/licenses/gpl-3.0.html'
148+
url = 'https://opensource.org/licenses/GPL-3.0'
127149
}
128150
}
129151

130152
developers {
131153
developer {
132154
id = 'AxenoDev'
133-
name = 'Timéo B.'
134-
email = 'tbavart@gmail.com'
155+
name = 'AxenoDev'
156+
url = 'https://axeno.me'
135157
}
136158
}
137159

@@ -143,18 +165,15 @@ publishing {
143165
}
144166
}
145167
}
146-
147168
repositories {
148169
maven {
149170
name = "GitHubPackages"
150171
url = uri("https://maven.pkg.github.com/AxenoDev/NoctisUI")
151172
credentials {
152-
username = System.getenv("GITHUB_USERNAME")
173+
username = System.getenv("GITHUB_ACTOR")
153174
password = System.getenv("GITHUB_TOKEN")
154175
}
155176
}
156-
157-
mavenLocal()
158177
}
159178
}
160179

jitpack.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
jdk:
2+
- openjdk21
3+
install:
4+
- ./gradlew publishToMavenLocal

0 commit comments

Comments
 (0)