File tree Expand file tree Collapse file tree 3 files changed +16
-42
lines changed
Expand file tree Collapse file tree 3 files changed +16
-42
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 }}"
16- show-progress : false
1711 - uses : actions/setup-java@v4
1812 with :
1913 java-version : 21
2014 distribution : ' temurin'
2115 cache : ' maven'
22- server-id : ossrh # Value of the distributionManagement/repository/id field of the pom.xml
23- server-username : MAVEN_USERNAME # env variable for username in deploy
24- server-password : MAVEN_PASSWORD # env variable for token in deploy
25- - name : Enforce project version ${{ github.event.inputs.tag }}
26- run : mvn versions:set -B -DnewVersion=${{ github.event.inputs.tag }}
16+ server-id : central
17+ server-username : MAVEN_CENTRAL_USERNAME
18+ server-password : MAVEN_CENTRAL_PASSWORD
19+ - name : Enforce project version ${{ github.event.release.tag_name }}
20+ run : mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
2721 - name : Deploy
2822 run : mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
2923 env :
3529 MAVEN_USERNAME : ${{ secrets.OSSRH_USERNAME }}
3630 MAVEN_PASSWORD : ${{ secrets.OSSRH_PASSWORD }}
3731 MAVEN_GPG_PASSPHRASE : ${{ secrets.RELEASES_GPG_PASSPHRASE }}
38- MAVEN_GPG_KEY : ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
32+ MAVEN_GPG_KEY : ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
3933 MAVEN_GPG_KEY_FINGERPRINT : ${{ vars.RELEASES_GPG_KEY_FINGERPRINT }}
Original file line number Diff line number Diff line change 2222 env :
2323 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2424 MAVEN_GPG_PASSPHRASE : ${{ secrets.RELEASES_GPG_PASSPHRASE }}
25- MAVEN_GPG_KEY : ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
25+ 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 4444 <dependency-check .version>12.1.0</dependency-check .version>
4545 <junit-tree-reporter .version>1.4.0</junit-tree-reporter .version>
4646 <jacoco .version>0.8.12</jacoco .version>
47- <nexus-staging .version>1 .7.0</nexus-staging .version>
47+ <central-publishing .version>0 .7.0</central-publishing .version>
4848
4949 <!-- Property used by surefire to determine jacoco engine -->
5050 <surefire .jacoco.args></surefire .jacoco.args>
372372
373373 <profile >
374374 <id >deploy-central</id >
375- <distributionManagement >
376- <repository >
377- <id >ossrh</id >
378- <name >Maven Central</name >
379- <url >https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url >
380- </repository >
381- </distributionManagement >
382375 <build >
383376 <plugins >
384377 <plugin >
385- <groupId >org.sonatype.plugins </groupId >
386- <artifactId >nexus-staging -maven-plugin</artifactId >
387- <version >${nexus-staging .version} </version >
378+ <groupId >org.sonatype.central </groupId >
379+ <artifactId >central-publishing -maven-plugin</artifactId >
380+ <version >${central-publishing .version} </version >
388381 <extensions >true</extensions >
389382 <configuration >
390- <serverId >ossrh</serverId >
391- <nexusUrl >https://s01.oss.sonatype.org/</nexusUrl >
392- <autoReleaseAfterClose >true</autoReleaseAfterClose >
383+ <publishingServerId >central</publishingServerId >
384+ <autoPublish >true</autoPublish >
393385 </configuration >
394386 </plugin >
395387 </plugins >
You can’t perform that action at this time.
0 commit comments