File tree Expand file tree Collapse file tree 3 files changed +20
-13
lines changed
Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -45,16 +45,18 @@ jobs:
4545 gradle-version : 8.14.2
4646
4747 - name : Build SNAPSHOT using Gradle
48- run : gradle build
48+ run : gradle publish
4949 env :
5050 LIB_VERSION : ${{ steps.gitversion.outputs.version }}-SNAPSHOT
5151
5252 - name : Publish SNAPSHOT using Gradle
53- run : gradle publish
53+ run : gradle jreleaserDeploy
5454 env :
5555 LIB_VERSION : ${{ steps.gitversion.outputs.version }}-SNAPSHOT
5656 JRELEASER_MAVENCENTRAL_USERNAME : ${{ secrets.OSS_SONATYPE_USERNAME }}
5757 JRELEASER_MAVENCENTRAL_PASSWORD : ${{ secrets.OSS_SONATYPE_PASSWORD }}
58+ JRELEASER_NEXUS2_USERNAME : ${{ secrets.OSS_SONATYPE_USERNAME }}
59+ JRELEASER_NEXUS2_PASSWORD : ${{ secrets.OSS_SONATYPE_PASSWORD }}
5860 JRELEASER_GPG_SECRET_KEY : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
5961 JRELEASER_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
6062
Original file line number Diff line number Diff line change @@ -38,16 +38,18 @@ jobs:
3838 gradle-version : 8.14.2
3939
4040 - name : Build library using Gradle
41- run : gradle build
41+ run : gradle publish
4242 env :
4343 LIB_VERSION : ${{ steps.gitversion.outputs.version }}
4444
4545 - name : Publish library using Gradle
46- run : gradle publish
46+ run : gradle jreleaserDeploy
4747 env :
4848 LIB_VERSION : ${{ steps.gitversion.outputs.version }}
4949 JRELEASER_MAVENCENTRAL_USERNAME : ${{ secrets.OSS_SONATYPE_USERNAME }}
5050 JRELEASER_MAVENCENTRAL_PASSWORD : ${{ secrets.OSS_SONATYPE_PASSWORD }}
51+ JRELEASER_NEXUS2_USERNAME : ${{ secrets.OSS_SONATYPE_USERNAME }}
52+ JRELEASER_NEXUS2_PASSWORD : ${{ secrets.OSS_SONATYPE_PASSWORD }}
5153 JRELEASER_GPG_SECRET_KEY : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
5254 JRELEASER_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
5355
Original file line number Diff line number Diff line change @@ -165,13 +165,7 @@ publishing {
165165
166166 repositories {
167167 maven {
168- def releasesRepoUrl = layout. buildDirectory. dir(' staging-deploy' )
169- def snapshotsRepoUrl = " https://central.sonatype.com/repository/maven-snapshots/"
170- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
171- credentials {
172- username = project. findProperty(" JRELEASER_MAVENCENTRAL_USERNAME" ) ?: System . getenv(" JRELEASER_MAVENCENTRAL_USERNAME" )
173- password = project. findProperty(" JRELEASER_MAVENCENTRAL_PASSWORD" ) ?: System . getenv(" JRELEASER_MAVENCENTRAL_PASSWORD" )
174- }
168+ url = layout. buildDirectory. dir(' staging-deploy' )
175169 }
176170 }
177171}
@@ -188,11 +182,20 @@ jreleaser {
188182 deploy {
189183 maven {
190184 mavenCentral {
191- sonatype {
192- active = ' ALWAYS '
185+ ' release-deploy ' {
186+ active = ' RELEASE '
193187 url = ' https://central.sonatype.com/api/v1/publisher'
188+ stagingRepository(' build/staging-deploy' )
189+ }
190+ }
191+ nexus2 {
192+ ' snapshot-deploy' {
193+ active = ' SNAPSHOT'
194+ snapshotUrl = ' https://central.sonatype.com/repository/maven-snapshots/'
194195 applyMavenCentralRules = true
195196 snapshotSupported = true
197+ closeRepository = true
198+ releaseRepository = true
196199 stagingRepository(' build/staging-deploy' )
197200 }
198201 }
You can’t perform that action at this time.
0 commit comments