Skip to content

Commit 7a9e593

Browse files
committed
🤔 First attempt using JReleaser and Central Portal
1 parent bcc6370 commit 7a9e593

File tree

5 files changed

+1478
-37
lines changed

5 files changed

+1478
-37
lines changed

‎.github/workflows/maven-publish.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
- name: Publish package
3131
uses: gradle/gradle-build-action@093dfe9d598ec5a42246855d09b49dc76803c005
3232
with:
33-
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
33+
arguments: publish jreleaserFullRelease
3434
env:
35-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
36-
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
37-
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
38-
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
35+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
36+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }}
37+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
38+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

‎build.gradle.kts‎

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jreleaser.model.Active
2+
13
val springBootVersion = "3.4.5"
24
val junitPlatformVersion = "1.10.2"
35
val embeddedRedisVersion = "1.4.3"
@@ -13,7 +15,7 @@ plugins {
1315
val adarshrTestLoggerVersion = "4.0.0"
1416
val sonarqubeVersion = "6.2.0.5505"
1517
val gradleReleasePluginVersion = "3.1.0"
16-
val gradleNexusPublishPluginVersion = "2.0.0"
18+
val jreleaserVersion = "1.18.0"
1719

1820
kotlin("jvm") version kotlinVersion
1921
id("io.spring.dependency-management") version springDependencyManagementVersion
@@ -24,7 +26,7 @@ plugins {
2426
id("maven-publish")
2527
id("signing")
2628
id("net.researchgate.release") version gradleReleasePluginVersion
27-
id("io.github.gradle-nexus.publish-plugin") version gradleNexusPublishPluginVersion
29+
id("org.jreleaser") version jreleaserVersion
2830
}
2931

3032
group = "io.github.tobi-laa"
@@ -94,17 +96,6 @@ tasks.jacocoTestReport {
9496
}
9597
}
9698

97-
nexusPublishing {
98-
repositories {
99-
sonatype {
100-
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
101-
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
102-
username = System.getenv("OSSRH_USERNAME")
103-
password = System.getenv("OSSRH_TOKEN")
104-
}
105-
}
106-
}
107-
10899
publishing {
109100
publications {
110101
create<MavenPublication>("mavenJava") {
@@ -154,6 +145,29 @@ publishing {
154145
}
155146
}
156147
}
148+
repositories {
149+
maven {
150+
url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI()
151+
}
152+
}
153+
}
154+
155+
jreleaser {
156+
signing {
157+
active = Active.ALWAYS
158+
armored = true
159+
}
160+
deploy {
161+
maven {
162+
mavenCentral {
163+
create("sonatype") {
164+
active = Active.ALWAYS
165+
url = "https://central.sonatype.com/api/v1/publisher"
166+
stagingRepository("build/staging-deploy")
167+
}
168+
}
169+
}
170+
}
157171
}
158172

159173
signing {
27.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)