-
Notifications
You must be signed in to change notification settings - Fork 2
31 lines (31 loc) · 1.04 KB
/
maven-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Publish package to the Maven Central Repository and GitHub Packages
on:
release:
types: [created]
push:
branches: [main, develop]
jobs:
publish:
runs-on: ubuntu-latest
environment: MAVEN
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: central
server-username: ${{ secrets.USERNAME }}
server-password: ${{ secrets.PASSWORD }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Publish to the Maven Central Repository
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} clean deploy
env:
MAVEN_USERNAME: ${{ secrets.USERNAME }}
MAVEN_PASSWORD: ${{ secrets.PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}