File tree Expand file tree Collapse file tree 3 files changed +15
-40
lines changed
Expand file tree Collapse file tree 3 files changed +15
-40
lines changed Original file line number Diff line number Diff line change 11name : Publish to Maven Central
22on :
3- workflow_dispatch :
4- inputs :
5- tag :
6- description : ' Tag'
7- required : true
8- default : ' 0.0.0'
3+ release :
4+ types : [published]
95jobs :
106 publish :
117 runs-on : ubuntu-latest
8+ if : startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
129 steps :
1310 - uses : actions/checkout@v4
14- with :
15- ref : " refs/tags/${{ github.event.inputs.tag }}"
1611 - uses : actions/setup-java@v4
1712 with :
1813 java-version : 21
1914 distribution : ' zulu'
2015 cache : ' maven'
21- server-id : ossrh # Value of the distributionManagement/repository/id field of the pom.xml
22- server-username : MAVEN_USERNAME # env variable for username in deploy
23- server-password : MAVEN_PASSWORD # env variable for token in deploy
24- - name : Verify project version = ${{ github.event.inputs.tag }}
16+ server-id : central
17+ server-username : MAVEN_CENTRAL_USERNAME
18+ server-password : MAVEN_CENTRAL_PASSWORD
19+ - name : Verify project version = ${{ github.event.release.tag_name }}
2520 run : |
2621 PROJECT_VERSION=$(./mvnw help:evaluate "-Dexpression=project.version" -q -DforceStdout)
27- test "$PROJECT_VERSION" = "${{ github.event.inputs.tag }}"
22+ test "$PROJECT_VERSION" = "${{ github.event.release.tag_name }}"
2823 - name : Deploy
2924 run : ./mvnw deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
3025 env :
31- MAVEN_USERNAME : ${{ secrets.OSSRH_USERNAME }}
32- MAVEN_PASSWORD : ${{ secrets.OSSRH_PASSWORD }}
26+ MAVEN_CENTRAL_USERNAME : ${{ secrets.MAVEN_CENTRAL_USERNAME }}
27+ MAVEN_CENTRAL_PASSWORD : ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
3328 MAVEN_GPG_PASSPHRASE : ${{ secrets.RELEASES_GPG_PASSPHRASE }}
3429 MAVEN_GPG_KEY : ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
3530 MAVEN_GPG_KEY_FINGERPRINT : ${{ vars.RELEASES_GPG_KEY_FINGERPRINT }}
Original file line number Diff line number Diff line change 2424 MAVEN_GPG_PASSPHRASE : ${{ secrets.RELEASES_GPG_PASSPHRASE }}
2525 MAVEN_GPG_KEY : ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
2626 MAVEN_GPG_KEY_FINGERPRINT : ${{ vars.RELEASES_GPG_KEY_FINGERPRINT }}
27- - name : Slack Notification
28- uses : rtCamp/action-slack-notify@v2
29- env :
30- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK_URL }}
31- SLACK_USERNAME : ' Cryptobot'
32- SLACK_ICON :
33- SLACK_ICON_EMOJI : ' :bot:'
34- SLACK_CHANNEL : ' cryptomator-desktop'
35- SLACK_TITLE : " Published ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}"
36- SLACK_MESSAGE : " Ready to <https://github.com/${{ github.repository }}/actions/workflows/publish-central.yml|deploy to Maven Central>."
37- SLACK_FOOTER :
38- MSG_MINIMAL : true
Original file line number Diff line number Diff line change 331331
332332 <profile >
333333 <id >deploy-central</id >
334- <distributionManagement >
335- <repository >
336- <id >ossrh</id >
337- <name >Maven Central</name >
338- <url >https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url >
339- </repository >
340- </distributionManagement >
341334 <build >
342335 <plugins >
343336 <plugin >
344- <groupId >org.sonatype.plugins </groupId >
345- <artifactId >nexus-staging -maven-plugin</artifactId >
346- <version >1 .7.0</version >
337+ <groupId >org.sonatype.central </groupId >
338+ <artifactId >central-publishing -maven-plugin</artifactId >
339+ <version >0 .7.0</version >
347340 <extensions >true</extensions >
348341 <configuration >
349- <serverId >ossrh</serverId >
350- <nexusUrl >https://s01.oss.sonatype.org/</nexusUrl >
351- <autoReleaseAfterClose >true</autoReleaseAfterClose >
342+ <publishingServerId >central</publishingServerId >
343+ <autoPublish >true</autoPublish >
352344 </configuration >
353345 </plugin >
354346 </plugins >
You can’t perform that action at this time.
0 commit comments