-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.14 KB
/
deploy-release.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
name: Deploy releases
on:
push:
tags:
- 'v*'
env:
MVN_ARGS: --batch-mode --errors --fail-fast --no-transfer-progress
jobs:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Install gpg secret key
run: |
gpg --batch --import <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}")
gpg --list-secret-keys --keyid-format LONG
- id: publish-to-central
name: Publish to Central Repository
run: |
mvn ${MVN_ARGS} -DskipTests -Psign clean deploy
env:
GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}