File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Maven Package
2+
3+ on :
4+ release :
5+ types : [created]
6+
7+ jobs :
8+ publish :
9+
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - uses : actions/checkout@v4
14+
15+ - name : Get the release version
16+ id : get_version
17+ run : echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT
18+
19+ - name : Set up JDK 17 for deploy to OSSRH
20+ uses : actions/setup-java@v4
21+ with :
22+ distribution : ' adopt'
23+ java-version : ' 17'
24+ server-id : ossrh
25+ server-username : MAVEN_USERNAME
26+ server-password : MAVEN_CENTRAL_TOKEN
27+ gpg-private-key : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
28+ gpg-passphrase : MAVEN_GPG_PASSPHRASE
29+
30+ - name : Build with Maven
31+ run : mvn -B package --file pom.xml
32+
33+ - name : Update package version
34+ run : mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
35+
36+ - name : Publish to Apache Maven Central
37+ run : mvn deploy -PossrhDeploy
38+ env :
39+ MAVEN_USERNAME : ${{ secrets.MAVEN_CENTRAL_USERNAME }}
40+ MAVEN_CENTRAL_TOKEN : ${{ secrets.MAVEN_CENTRAL_TOKEN }}
41+ MAVEN_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
42+
43+ - name : Set up JDK 17 for deploy to github packages
44+ uses : actions/setup-java@v4
45+ with :
46+ distribution : ' adopt'
47+ java-version : ' 17'
48+ server-id : github
49+
50+ - name : Publish to GitHub Packages Apache Maven
51+ run : mvn deploy -PgithubDeploy
52+ env :
53+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments