Skip to content

Commit 76b1364

Browse files
committed
Add JReleaser to deploy to Portal Publisher API
(cherry picked from commit 16804a5)
1 parent d6b6ff7 commit 76b1364

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ jobs:
3030
run: |
3131
./gradlew publish \
3232
-Pversion="${{github.event.release.tag_name}}" --scan --no-daemon -i
33+
34+
- name: Run Gradle Deploy
35+
run: |
36+
./gradlew jreleaserDeploy --scan --no-daemon -i
3337
env:
34-
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
35-
OSSRH_PASSWORD: ${{secrets.OSSRH_PASSWORD}}
38+
JRELEASER_GPG_PUBLIC_KEY: ${{ vars.GPG_PUBLIC_KEY }}
39+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SIGNING_KEY }}
40+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
41+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
42+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.JRELEASER_MAVENCENTRAL_PASSWORD }}

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ plugins {
1515
id 'com.gradleup.shadow' version '8.3.0'
1616
id 'me.champeau.gradle.japicmp' version '0.4.3' apply false
1717
id 'com.diffplug.spotless' version '6.22.0' apply false
18+
id 'org.jreleaser' version '1.18.0' apply false
1819
}
1920

2021
apply from: "$rootDir/gradle/ci-support.gradle"

gradle/publishing.gradle

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'maven-publish'
2+
apply plugin: 'org.jreleaser'
23

34
task sourceJar(type: Jar) {
45
archiveClassifier.set( 'sources')
@@ -95,10 +96,27 @@ publishing {
9596
}
9697
repositories {
9798
maven {
98-
url("https://oss.sonatype.org/service/local/staging/deploy/maven2")
99-
credentials {
100-
username = System.getenv("OSSRH_USERNAME")
101-
password = System.getenv("OSSRH_PASSWORD")
99+
url = layout.buildDirectory.dir('staging-deploy')
100+
}
101+
}
102+
}
103+
104+
jreleaser {
105+
signing {
106+
active = 'ALWAYS'
107+
armored = true
108+
}
109+
deploy {
110+
maven {
111+
mavenCentral {
112+
central {
113+
active = 'ALWAYS'
114+
url = 'https://central.sonatype.com/api/v1/publisher'
115+
stagingRepository(layout.buildDirectory.dir("staging-deploy").get().toString())
116+
stage = 'UPLOAD'
117+
applyMavenCentralRules = true
118+
namespace = 'org.testcontainers'
119+
}
102120
}
103121
}
104122
}

0 commit comments

Comments
 (0)