File tree Expand file tree Collapse file tree 2 files changed +61
-2
lines changed
Expand file tree Collapse file tree 2 files changed +61
-2
lines changed Original file line number Diff line number Diff line change 4343 GH_PACKAGES_WRITE_TOKEN : ${{ secrets.GH_PACKAGES_WRITE_TOKEN }}
4444 IPREGISTRY_API_KEY : ${{ secrets.IPREGISTRY_API_KEY }}
4545 IPREGISTRY_DATASETS_SECRET_KEY : ${{ secrets.IPREGISTRY_DATASETS_SECRET_KEY }}
46+
47+ - name : Publish artifacts to staging
48+ env :
49+ ORG_GRADLE_PROJECT_signingKey : ${{ secrets.GPG_SECRET_KEY }}
50+ ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.GPG_PASSPHRASE }}
51+ run : ./gradlew publishMavenPublicationToStagingRepository
4652
47- - name : Release with JReleaser
53+ - name : Deploy to Maven Central and Create GitHub Release
4854 env :
4955 JRELEASER_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5056 JRELEASER_MAVENCENTRAL_USERNAME : ${{ secrets.MAVEN_CENTRAL_USERNAME }}
5460 JRELEASER_GPG_PUBLIC_KEY : ${{ secrets.GPG_PUBLIC_KEY }}
5561 run : |
5662 mkdir -p build/jreleaser
57- ./gradlew jreleaserFullRelease ${{ inputs.dry-run && '--dryrun' || '' }}
63+ ./gradlew jreleaserDeploy jreleaserRelease ${{ inputs.dry-run && '--dryrun' || '' }}
Original file line number Diff line number Diff line change @@ -2,11 +2,18 @@ import java.text.SimpleDateFormat
22
33plugins {
44 id ' java-library'
5+ id ' maven-publish'
6+ id ' signing'
57 id ' org.jreleaser' version ' 1.16.0'
68}
79
10+ ext {
11+ copyright = ' 2019-2025 Ipregistry'
12+ }
13+
814group = ' co.ipregistry'
915version = ' 5.0.0'
16+ description = ' Official Java client for Ipregistry, a fast, reliable IP geolocation and threat data API.'
1017
1118repositories {
1219 mavenCentral()
@@ -104,3 +111,49 @@ test {
104111integrationTest {
105112 useJUnitPlatform()
106113}
114+
115+ publishing {
116+ publications {
117+ maven(MavenPublication ) {
118+ from components. java
119+
120+ pom {
121+ name = ' Ipregistry Client'
122+ description = ' Official Java client for Ipregistry, a fast, reliable IP geolocation and threat data API.'
123+ url = ' https://github.com/ipregistry/ipregistry-java'
124+
125+ licenses {
126+ license {
127+ name = ' The Apache License, Version 2.0'
128+ url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
129+ }
130+ }
131+
132+ developers {
133+ developer {
134+ name = ' Ipregistry Team'
135+ organizationUrl = ' https://ipregistry.co'
136+ }
137+ }
138+
139+ scm {
140+ connection = ' scm:git:git://github.com/ipregistry/ipregistry-java.git'
141+ developerConnection = ' scm:git:ssh://github.com:ipregistry/ipregistry-java.git'
142+ url = ' https://github.com/ipregistry/ipregistry-java/tree/main'
143+ }
144+ }
145+ }
146+ }
147+
148+ repositories {
149+ maven {
150+ name = ' staging'
151+ url = layout. buildDirectory. dir(' staging-deploy' )
152+ }
153+ }
154+ }
155+
156+ signing {
157+ required = { gradle. taskGraph. hasTask(' publish' ) }
158+ sign publishing. publications. maven
159+ }
You can’t perform that action at this time.
0 commit comments