-
Notifications
You must be signed in to change notification settings - Fork 112
56 lines (52 loc) · 1.61 KB
/
maven.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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Master
on:
push:
branches:
- 'master'
- 'hotfix/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 11 ]
steps:
- uses: actions/checkout@v2
- name: Build with Maven
run: mvn clean install
deploy:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
server-id: ossrh
distribution: adopt
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: list-keys
run: |
gpg --list-keys --keyid-format LONG
- name: Get GPG Key ID
id: gpg-key-id
run: |
gpg --list-secret-keys --keyid-format LONG | grep '^sec' | awk '{print $2}' | cut -d'/' -f2
- name: Extend GPG key expiration
run: |
echo -e "expire\n1y\nsave" | gpg --batch --command-fd 0 --edit-key C2B7EEEC51372BAB
- name: Publish package to maven central
run: mvn --batch-mode clean deploy -P central-deploy -DskipTests=true --update-snapshots -Prelease
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}