-
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.55 KB
/
maven-publish-release-workflow.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
name: Publish Release CI
on:
push:
branches:
- master
# https://stackoverflow.com/questions/61096521/how-to-use-gpg-key-in-github-actions
# https://github.com/actions/setup-java/issues/83
# FIX - https://stackoverflow.com/questions/53992950/maven-gpg-plugin-failing-with-inappropriate-ioctl-for-device-when-running-unde
# https://keys.openpgp.org
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Fix GPG
run: export GPG_TTY=$(tty)
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'adopt'
cache: maven
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Setup Git
run: |
git --version
git config user.name "GitHub Actions"
git config user.email "<>"
git status
- name: Test and Publish Package to Apache Maven Central
run: mvn -B release:clean release:prepare release:perform
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
API_PASSWORD: ${{ secrets.API_PASSWORD }}
RELEASE_API_PASSWORD: ${{ secrets.RELEASE_API_PASSWORD }}