-
Notifications
You must be signed in to change notification settings - Fork 10
65 lines (58 loc) · 1.83 KB
/
maven-publish.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
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
60
61
62
63
64
65
name: Publish package to the Maven Central Repository and GitHub Packages
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out Repository
uses: actions/checkout@v3
#To maven central
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
cache: maven
server-id: ossrh
#gpg is only needed for the first run
gpg-private-key: ${{ secrets.GPG_JAR_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Deploy to the Maven Central Repository
run: |
mvn -B "-Dgpg.passphrase=${{ secrets.GPG_JAR_PASSWORD }}" -P ossrh deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_JAR_PASSWORD }}
# To github packages!
- name: Set up Java for publishing to Github Packages
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
cache: maven
server-id: github
- name: Deploy to GitHub Packages
run: |
mvn -B -f pom.xml -Dgpg.passphrase=${{ secrets.GPG_JAR_PASSWORD }} -P github deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_JAR_PASSWORD }}