-
Notifications
You must be signed in to change notification settings - Fork 14
32 lines (32 loc) · 1.13 KB
/
deploy_to_central.yaml
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
32
name: Publish package to the Maven Central Repository
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
- name: Checkout
uses: actions/checkout@v2
- name: Set up setting.xml
uses: s4u/[email protected]
with:
servers: |
[{
"id": "ossrh",
"username": "${{ secrets.OSSRH_USERNAME }}",
"password": "${{ secrets.OSSRH_TOKEN }}"
}]
- name: Set up Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: "11"
distribution: "adopt"
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -s ~/.m2/settings.xml -Dproject.username=${{ secrets.OSSRH_USERNAME }} -Dproject.password=${{ secrets.OSSRH_TOKEN }} deploy -Pdeploy