@@ -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
@@ -213,11 +213,12 @@ jobs:
213213 with :
214214 servers : |
215215 [{
216- "id": "sonatype-nexus-staging ",
217- "username": "${{ secrets.SONATYPE_USERNAME }}",
218- "password": "${{ secrets.SONATYPE_PASSWORD }}"
216+ "id": "central ",
217+ "username": "${{ secrets.MAVEN_CENTRAL_USERNAME }}",
218+ "password": "${{ secrets.MAVEN_CENTRAL_PASSWORD }}"
219219 }]
220220
221+
221222 # Cache .m2/repository
222223 # Caching of maven dependencies
223224 - uses : actions/cache@v4
@@ -232,18 +233,15 @@ jobs:
232233 working-directory : ./prepare-release-workspace/
233234 run : brew bundle
234235
235- - name : Create local staging directory
236- run : mkdir -p ~/local-staging
237-
238236 - name : Stage snapshots to local staging directory
239237 working-directory : ./prepare-release-workspace/
240- 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 }}
238+ run : ./mvnw -B -ntp clean package javadoc:jar gpg:sign org.sonatype.central:central-publishing -maven-plugin:publish - DskipTests=true
241239
242240 - name : Upload local staging directory
243241 uses : actions/upload-artifact@v4
244242 with :
245243 name : ${{ matrix.setup }}-local-staging
246- path : ~/local -staging
244+ path : ./prepare-release-workspace/target/central -staging
247245 if-no-files-found : error
248246 include-hidden-files : true
249247
@@ -314,34 +312,18 @@ jobs:
314312 # all together with one maven command.
315313 - name : Merge staging repositories
316314 working-directory : ./prepare-release-workspace/
317- run : bash ./.github/scripts/merge_local_staging.sh ~/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
318-
319- # Caching of maven dependencies
320- - uses : actions/cache@v4
321- continue-on-error : true
322- with :
323- path : ~/.m2/repository
324- key : deploy-staged-release-maven-cache-${{ hashFiles('**/pom.xml') }}
325- restore-keys : |
326- deploy-staged-release-maven-cache-
315+ run : bash ./.github/scripts/local_staging_merge_release.sh ~/local-staging ~/macos-x86_64-local-staging ~/macos-aarch64-local-staging ~/linux-aarch64-local-staging ~/linux-x86_64-local-staging
327316
328- - uses : s4u/maven-settings-action@v3.0.0
329- with :
330- servers : |
331- [{
332- "id": "sonatype-nexus-staging",
333- "username": "${{ secrets.SONATYPE_USERNAME }}",
334- "password": "${{ secrets.SONATYPE_PASSWORD }}"
335- }]
317+ - name : Create bundle
318+ working-directory : ./prepare-release-workspace/
319+ run : bash ./.github/scripts/bundle_create.sh ~/central-bundle.zip ~/local-staging/
336320
337- - name : Deploy local staged artifacts
321+ - name : Upload bundle to maven central
338322 working-directory : ./prepare-release-workspace/
339- # If we don't want to close the repository we can add -DskipStagingRepositoryClose=true
340- 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/local-staging -DskipStagingRepositoryClose=true
323+ run : bash ./.github/scripts/bundle_upload.sh ~/central-bundle.zip ${{ secrets.MAVEN_CENTRAL_USERNAME }} ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
341324
342325 - name : Rollback release on failure
343326 working-directory : ./prepare-release-workspace/
344327 if : ${{ failure() }}
345328 # Rollback the release in case of an failure
346329 run : bash ./.github/scripts/release_rollback.sh release.properties netty/netty-incubator-codec-ohttp main
347-
0 commit comments