-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.45 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
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Release
on:
release:
types: [created]
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
environment: Release
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: List GPG keys
run: gpg -K
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Adjust version
run: mvn --no-transfer-progress --batch-mode versions:set "-DnewVersion=${{ github.event.release.tag_name }}"
- name: Maven Deploy - GitHub Packages
run: mvn --no-transfer-progress --batch-mode -Psign "-Dgpg.passphrase=${{ secrets.PASSPHRASE }}" -DskipTests=true clean deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Maven Deploy - Maven Central
run: mvn --settings=build/settings-maven-central.xml --no-transfer-progress --batch-mode -Psign -Pmaven-central "-Dgpg.passphrase=${{ secrets.PASSPHRASE }}" -DskipTests=true clean deploy
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}