-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.09 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
name: Release
# Run workflow on tags to the `master` branch
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Java and Maven
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Create settings.xml file
uses: whelk-io/maven-settings-xml-action@v22
with:
servers: >
[
{
"id": "central",
"username": "${{ secrets.SONATYPE_CENTRAL_USERNAME }}",
"password": "${{ secrets.SONATYPE_CENTRAL_PASSWORD }}"
}
]
- name: Install gpg secret key
run: |
# Install gpg secret key
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
# Verify gpg secret key
gpg --list-secret-keys --keyid-format LONG
- name: Publish package
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -P deploy deploy