Skip to content

Commit 97ab422

Browse files
committed
feat: publish to maven
1 parent bce2ee5 commit 97ab422

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish To Maven
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Install gpg secret key
16+
run: |
17+
cat <(echo -e "${{ secrets.SIGNING_KEY }}") | gpg --batch --import
18+
19+
- name: Set up Maven Central Repository
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '8'
23+
distribution: 'temurin'
24+
server-id: central
25+
server-username: MAVEN_USERNAME
26+
server-password: MAVEN_PASSWORD
27+
gpg-private-key: ${{ secrets.SIGNING_KEY }}
28+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
29+
30+
- name: Publish package
31+
run: |
32+
mvn \
33+
--no-transfer-progress \
34+
--batch-mode \
35+
-Dgpg.passphrase=${{ secrets.SIGNING_PASSWORD }} \
36+
clean deploy -P release-sign-artifacts -e
37+
env:
38+
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
39+
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
40+
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }}

0 commit comments

Comments
 (0)