-
Notifications
You must be signed in to change notification settings - Fork 9
35 lines (33 loc) · 1.04 KB
/
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
name: Release
on:
push:
tags: ["v.*"]
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/setup-java@v1
with:
java-version: 8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Set Release Version
run: mvn -B versions:set -DnewVersion=${GITHUB_REF:11} -DgenerateBackupPoms=false
- name: Decode GPG Keyring File
run: |
mkdir ~/.gnupg
chmod 0700 ~/.gnupg
echo "${{secrets.GPG_PRIVATE_KEY}}" > ~/.gnupg/gpg-key.asc
gpg --no-tty --batch --yes --import ~/.gnupg/gpg-key.asc
rm ~/.gnupg/gpg-key.asc
- name: Deploy to Maven Central
run: mvn -B deploy -Possrh -Dgpg.passphrase="${{secrets.GPG_PASSPHRASE}}"
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}