File tree Expand file tree Collapse file tree 2 files changed +93
-0
lines changed
Expand file tree Collapse file tree 2 files changed +93
-0
lines changed Original file line number Diff line number Diff line change 11name : Publish package to the GitHub Packages
22on :
3+ workflow_dispatch :
34 release :
45 types : [created, published, edited]
56jobs :
910 contents : read
1011 packages : write
1112 steps :
13+ - name : Set up Java for publishing to Maven Central Packages
14+ uses : actions/setup-java@v4
15+ with :
16+ java-version : ' 21'
17+ distribution : ' temurin'
18+ server-id : ' github'
19+ cache : maven
20+ gpg-private-key : ${{ secrets.GPG_PRIVATE_KEY }}
21+ server-id : central
22+ server-username : SONATYPE_USERNAME
23+ server-password : SONATYPE_TOKEN
24+ - name : Release with Maven
25+ run : |
26+ mvn -B -ntp -Dstyle.color=always release:prepare
27+ VERSION=`cat release.properties | grep scm.tag= | cut -d'=' -f2`
28+ mvn -B -ntp -Dstyle.color=always release:perform
29+ echo "Released ${VERSION} 🚀" >> $GITHUB_STEP_SUMMARY
30+ env :
31+ GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
32+ SONATYPE_USERNAME : ${{ secrets.OSSRH_USERNAME }}
33+ SONATYPE_TOKEN : ${{ secrets.OSSRH_TOKEN }}
34+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1235 - name : Set up Java for publishing to GitHub Packages
1336 uses : actions/setup-java@v4
1437 with :
Original file line number Diff line number Diff line change 364364 </plugin >
365365 </plugins >
366366 </reporting >
367+
368+ <profiles >
369+ <profile >
370+ <id >publisher</id >
371+ <build >
372+ <plugins >
373+ <plugin >
374+ <groupId >org.apache.maven.plugins</groupId >
375+ <artifactId >maven-gpg-plugin</artifactId >
376+ <version >3.2.7</version >
377+ <executions >
378+ <execution >
379+ <id >sign-artifacts</id >
380+ <phase >verify</phase >
381+ <goals >
382+ <goal >sign</goal >
383+ </goals >
384+ </execution >
385+ </executions >
386+ </plugin >
387+ <plugin >
388+ <groupId >org.apache.maven.plugins</groupId >
389+ <artifactId >maven-javadoc-plugin</artifactId >
390+ <version >3.6.3</version >
391+ <executions >
392+ <execution >
393+ <goals >
394+ <goal >jar</goal >
395+ </goals >
396+ </execution >
397+ </executions >
398+ </plugin >
399+ <plugin >
400+ <groupId >org.apache.maven.plugins</groupId >
401+ <artifactId >maven-source-plugin</artifactId >
402+ <version >3.3.1</version >
403+ <executions >
404+ <execution >
405+ <goals >
406+ <goal >jar-no-fork</goal >
407+ </goals >
408+ </execution >
409+ </executions >
410+ </plugin >
411+ <plugin >
412+ <groupId >org.sonatype.central</groupId >
413+ <artifactId >central-publishing-maven-plugin</artifactId >
414+ <version >0.6.0</version >
415+ <extensions >true</extensions >
416+ <configuration >
417+ <autoPublish >false</autoPublish >
418+ <deploymentName >${project.artifactId} :${project.version} </deploymentName >
419+ <waitUntil >validated</waitUntil >
420+ <publishingServerId >ossrh</publishingServerId >
421+ </configuration >
422+ </plugin >
423+ <plugin >
424+ <groupId >org.apache.maven.plugins</groupId >
425+ <artifactId >maven-release-plugin</artifactId >
426+ <version >3.1.1</version >
427+ <configuration >
428+ <arguments >-ntp</arguments >
429+ <scmCommentPrefix />
430+ <tagNameFormat >v@{project.version}</tagNameFormat >
431+ </configuration >
432+ </plugin >
433+ </plugins >
434+ </build >
435+ </profile >
436+ </profiles >
367437</project >
You can’t perform that action at this time.
0 commit comments