@@ -128,9 +128,9 @@ jobs:
128
128
with :
129
129
servers : |
130
130
[{
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 }}"
134
134
}]
135
135
136
136
- name : Create local staging directory
@@ -152,7 +152,7 @@ jobs:
152
152
uses : actions/upload-artifact@v4
153
153
with :
154
154
name : ${{ matrix.setup }}-local-staging
155
- path : ~/local -staging
155
+ path : ./prepare-release-workspace/target/central -staging
156
156
if-no-files-found : error
157
157
include-hidden-files : true
158
158
@@ -232,22 +232,20 @@ jobs:
232
232
with :
233
233
servers : |
234
234
[{
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 }}"
238
238
}]
239
239
240
240
- name : Stage release to local staging directory
241
241
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'
245
243
246
244
- name : Upload local staging directory
247
245
uses : actions/upload-artifact@v4
248
246
with :
249
247
name : windows-x86_64-local-staging
250
- path : /local -staging
248
+ path : ./prepare-release-workspace/target/central -staging
251
249
if-no-files-found : error
252
250
include-hidden-files : true
253
251
@@ -308,9 +306,9 @@ jobs:
308
306
with :
309
307
servers : |
310
308
[{
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 }}"
314
312
}]
315
313
316
314
# Cache .m2/repository
@@ -332,13 +330,13 @@ jobs:
332
330
333
331
- name : Stage snapshots to local staging directory
334
332
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
336
334
337
335
- name : Upload local staging directory
338
336
uses : actions/upload-artifact@v4
339
337
with :
340
338
name : ${{ matrix.setup }}-local-staging
341
- path : ~/local -staging
339
+ path : ./prepare-release-workspace/target/central -staging
342
340
if-no-files-found : error
343
341
include-hidden-files : true
344
342
@@ -415,7 +413,7 @@ jobs:
415
413
# all together with one maven command.
416
414
- name : Merge staging repositories
417
415
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
419
417
420
418
# Caching of maven dependencies
421
419
- uses : actions/cache@v4
@@ -426,19 +424,13 @@ jobs:
426
424
restore-keys : |
427
425
deploy-staged-release-maven-cache-
428
426
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/
437
430
438
- - name : Deploy local staged artifacts
431
+ - name : Upload bundle to maven central
439
432
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 }}
442
434
443
435
- name : Rollback release on failure
444
436
working-directory : ./prepare-release-workspace/
0 commit comments