@@ -128,9 +128,9 @@ jobs:
128128 with :
129129 servers : |
130130 [{
131- "id": "sonatype-nexus-staging ",
132- "username": "${{ secrets.SONATYPE_USERNAME }}",
133- "password": "${{ secrets.SONATYPE_PASSWORD }}"
131+ "id": "central ",
132+ "username": "${{ secrets.MAVEN_CENTRAL_USERNAME }}",
133+ "password": "${{ secrets.MAVEN_CENTRAL_PASSWORD }}"
134134 }]
135135
136136 - name : Create local staging directory
@@ -152,7 +152,7 @@ jobs:
152152 uses : actions/upload-artifact@v4
153153 with :
154154 name : ${{ matrix.setup }}-local-staging
155- path : ~/local -staging
155+ path : ./prepare-release-workspace/target/central -staging
156156 if-no-files-found : error
157157 include-hidden-files : true
158158
@@ -232,22 +232,20 @@ jobs:
232232 with :
233233 servers : |
234234 [{
235- "id": "sonatype-nexus-staging ",
236- "username": "${{ secrets.SONATYPE_USERNAME }}",
237- "password": "${{ secrets.SONATYPE_PASSWORD }}"
235+ "id": "central ",
236+ "username": "${{ secrets.MAVEN_CENTRAL_USERNAME }}",
237+ "password": "${{ secrets.MAVEN_CENTRAL_PASSWORD }}"
238238 }]
239239
240240 - name : Stage release to local staging directory
241241 working-directory : ${{ github.workspace }}/prepare-release-workspace
242- env :
243- LOCAL_STAGING_DIR : ${{ github.workspace }}/prepare-release-workspace/local-staging
244- run : ./mvnw.cmd -B -ntp --file pom.xml clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/local-staging -DskipRemoteStaging=true -DskipTests=true -D'checkstyle.skip=true'
242+ run : ./mvnw.cmd -B -ntp clean package javadoc:jar gpg:sign org.sonatype.central:central-publishing-maven-plugin:publish -DskipTests=true -D'checkstyle.skip=true'
245243
246244 - name : Upload local staging directory
247245 uses : actions/upload-artifact@v4
248246 with :
249247 name : windows-x86_64-local-staging
250- path : /local -staging
248+ path : ./prepare-release-workspace/target/central -staging
251249 if-no-files-found : error
252250 include-hidden-files : true
253251
@@ -308,9 +306,9 @@ jobs:
308306 with :
309307 servers : |
310308 [{
311- "id": "sonatype-nexus-staging ",
312- "username": "${{ secrets.SONATYPE_USERNAME }}",
313- "password": "${{ secrets.SONATYPE_PASSWORD }}"
309+ "id": "central ",
310+ "username": "${{ secrets.MAVEN_CENTRAL_USERNAME }}",
311+ "password": "${{ secrets.MAVEN_CENTRAL_PASSWORD }}"
314312 }]
315313
316314 # Cache .m2/repository
@@ -332,13 +330,13 @@ jobs:
332330
333331 - name : Stage snapshots to local staging directory
334332 working-directory : ./prepare-release-workspace/
335- run : ./mvnw -B -ntp clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging -maven-plugin:deploy -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=$HOME/local-staging -DskipRemoteStaging=true - DskipTests=true -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Dgpg.keyname=${{ secrets.GPG_KEYNAME }}
333+ run : ./mvnw -B -ntp clean package javadoc:jar gpg:sign org.sonatype.central:central-publishing -maven-plugin:publish - DskipTests=true
336334
337335 - name : Upload local staging directory
338336 uses : actions/upload-artifact@v4
339337 with :
340338 name : ${{ matrix.setup }}-local-staging
341- path : ~/local -staging
339+ path : ./prepare-release-workspace/target/central -staging
342340 if-no-files-found : error
343341 include-hidden-files : true
344342
@@ -415,7 +413,7 @@ jobs:
415413 # all together with one maven command.
416414 - name : Merge staging repositories
417415 working-directory : ./prepare-release-workspace/
418- run : bash ./.github/scripts/merge_local_staging .sh ~/local-staging/staging ~/windows-x86_64-local-staging/staging ~/macos-x86_64-local-staging/staging ~/macos-aarch64-local-staging/staging ~/linux-aarch64-local-staging/staging ~/linux-x86_64-local-staging/ staging
416+ run : bash ./.github/scripts/local_staging_merge_release .sh ~/local-staging ~/windows-x86_64-local-staging ~/macos-x86_64-local-staging ~/macos-aarch64-local-staging ~/linux-aarch64-local-staging ~/linux-x86_64-local-staging
419417
420418 # Caching of maven dependencies
421419 - uses : actions/cache@v4
@@ -426,19 +424,13 @@ jobs:
426424 restore-keys : |
427425 deploy-staged-release-maven-cache-
428426
429- 430- with :
431- servers : |
432- [{
433- "id": "sonatype-nexus-staging",
434- "username": "${{ secrets.SONATYPE_USERNAME }}",
435- "password": "${{ secrets.SONATYPE_PASSWORD }}"
436- }]
427+ - name : Create bundle
428+ working-directory : ./prepare-release-workspace/
429+ run : bash ./.github/scripts/bundle_create.sh ~/central-bundle.zip ~/local-staging/
437430
438- - name : Deploy local staged artifacts
431+ - name : Upload bundle to maven central
439432 working-directory : ./prepare-release-workspace/
440- # If we don't want to close the repository we can add -DskipStagingRepositoryClose=true
441- run : ./mvnw -B -ntp --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/home/runner/local-staging -DskipStagingRepositoryClose=true
433+ run : bash ./.github/scripts/bundle_upload.sh ~/central-bundle.zip ${{ secrets.MAVEN_CENTRAL_USERNAME }} ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
442434
443435 - name : Rollback release on failure
444436 working-directory : ./prepare-release-workspace/
0 commit comments