-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (59 loc) · 1.83 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Publish packages
on:
push:
branches:
- master
- '*.x'
jobs:
publish-to-github-packages:
name: Publish to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: zulu
server-id: github
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Echo settings.xml
run: cat /home/runner/.m2/settings.xml
- name: Publish packages
run: mvn -P github --batch-mode clean deploy
env:
MAVEN_USERNAME: ${{ secrets.GHPKG_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.GHPKG_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
publish-to-maven-central:
name: Publish to Maven Central
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: zulu
server-id: sonatype
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Echo settings.xml
run: cat /home/runner/.m2/settings.xml
- name: Publish packages
run: mvn -P sonatype --batch-mode clean deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}