Skip to content

Commit 9cca7a4

Browse files
Create maven-publish.yml
1 parent 4b06464 commit 9cca7a4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish package to the Maven Central Repository
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Set up Maven Central Repository
11+
uses: actions/setup-java@v4
12+
with:
13+
java-version: '21'
14+
distribution: 'temurin'
15+
server-id: central
16+
server-username: MAVEN_USERNAME
17+
server-password: MAVEN_PASSWORD
18+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
19+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
20+
- name: Set version
21+
run: mvn versions:set -DnewVersion=${{ github.event.release.tag_name }}
22+
- name: Publish package
23+
run: mvn -P release --batch-mode deploy -DskipTests
24+
env:
25+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
26+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
27+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)