Skip to content

Commit 63d5059

Browse files
trying to make JReleaser work
1 parent 878dc6e commit 63d5059

File tree

5 files changed

+77
-18
lines changed

5 files changed

+77
-18
lines changed

build.gradle

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ plugins {
1111
id 'maven-publish'
1212
id 'net.minecraftforge.gradle' version '6.+'
1313
id 'org.spongepowered.mixin' version '0.7.+'
14+
id 'org.jreleaser' version '1.17.0'
15+
1416
}
1517

1618
import java.nio.file.Files
@@ -24,11 +26,12 @@ def loadEnv() {
2426
if (matcher.matches()) {
2527
def key = matcher[0][1]
2628
def value = matcher[0][2]
27-
System.setProperty(key, value)
29+
System.setProperty(key as String, value as String)
2830
}
2931
}
3032
}
3133
}
34+
3235
loadEnv()
3336
version = mod_version
3437
group = mod_group_id
@@ -215,26 +218,59 @@ tasks.test {
215218
// }
216219

217220
// Example configuration to allow publishing using the maven-publish plugin
218-
publishing {
219-
publications {
220-
register('mavenJava', MavenPublication) {
221-
artifactId = 'formic-api-'+ minecraft_version // <-- valid Maven ID (no spaces)
222-
groupId = 'com.rae.formicapi' // <-- choose your group
223-
version = mod_version // <-- version of your mod/library
224-
225-
artifact jar
226221

222+
//def reobfJarFile = tasks.named('jar').get().archiveFile.get().asFile.absolutePath
223+
224+
jreleaser {
225+
project {
226+
name = 'FormicAPI'
227+
version = mod_version
228+
description = 'A Minecraft modding API for the Engineer Colony'
229+
authors = ['RealAntEngineer']
230+
license = 'MIT'
231+
// Project homepage
232+
java {
233+
version = '17'
227234
}
235+
website = 'https://github.com/RealAntEngineer/FormicAPI'
228236
}
229-
repositories {//TODO use a more practical
237+
238+
deploy {
230239
maven {
231-
url = uri("https://maven.pkg.github.com/RealAntEngineer/Formic_API")
232-
credentials {
233-
username = System.getProperty("USERNAME")
234-
password = System.getProperty("TOKEN")
240+
mavenCentral {
241+
main {
242+
active = 'ALWAYS'
243+
url = 'https://s01.oss.sonatype.org/services/staging/deploy/maven2/' // new token-based endpoint
244+
245+
username = System.getProperty('SONATYPE_USERNAME')
246+
password = System.getProperty('SONATYPE_TOKEN')
247+
}
235248
}
236249
}
237250
}
251+
signing {
252+
//active = 'ALWAYS'
253+
//armored = true
254+
//mode = 'MEMORY'
255+
secretKey = System.getProperty('SONATYPE_USERNAME')
256+
passphrase = System.getProperty('SONATYPE_TOKEN')
257+
}
258+
259+
distributions {
260+
main {
261+
artifact {
262+
path = "$buildDir/libs/formic-api-${minecraft_version}.jar"
263+
}
264+
extraProperties.put('groupId', 'io.github.realantengineer.formicapi')
265+
extraProperties.put('artifactId', "formic-api-${minecraft_version}")
266+
extraProperties.put('version', mod_version)
267+
}
268+
}
269+
/*release {
270+
github {
271+
active = 'NEVER'
272+
}
273+
}*/
238274
}
239275

240276
tasks.withType(JavaCompile).configureEach {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ jei_version=15.19.5.99
3030

3131
curios_version = 5.2.0-beta.3+1.20.1
3232

33-
mod_group_id=com.rae.formicapi
33+
mod_group_id=io.github.realantengineer.formicapi
3434
mod_authors=Real Ant Engineer
3535
mod_description=Example mod description.\nNewline characters can be used and will be replaced properly.

jreleaser.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
project:
2+
name: FormicAPI
3+
version: 1.3.0
4+
description: A Minecraft modding API for the Engineer Colony
5+
authors:
6+
- RealAntEngineer
7+
license: MIT
8+
website: https://github.com/RealAntEngineer/FormicAPI
9+
vcs:
10+
url: https://github.com/RealAntEngineer/FormicAPI
11+
tag: v1.3.0
12+
13+
signing:
14+
active: ALWAYS
15+
armored: true
16+
17+
deploy:
18+
maven:
19+
central:
20+
active: ALWAYS
21+
url: https://s01.oss.sonatype.org/service/local/
22+
snapshotUrl: https://s01.oss.sonatype.org/content/repositories/snapshots/
23+
stagingUrl: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
24+
sign: true
25+
autoRelease: true

settings.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ pluginManagement {
99
name = "ParchmentMC"
1010
url = "https://maven.parchmentmc.org"
1111
}
12-
gradlePluginPortal()
13-
1412
}
1513
}
1614

src/main/resources/formicapi.mixins.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"required": false,
33
"minVersion": "0.8",
44
"priority": 900,
5-
"package": "com.rae.formicapi.mixin",
5+
"package": "io.github.realantengineer.formicapi.mixin",
66
"compatibilityLevel": "JAVA_17",
77
"refmap": "formicapi.refmap.json",
88
"mixins" : [],

0 commit comments

Comments
 (0)