Skip to content

Commit c6de8de

Browse files
committed
Add publish workflow
1 parent 2b15fee commit c6de8de

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Publish to Maven Central"
2+
3+
on:
4+
push:
5+
tags: "*"
6+
7+
jobs:
8+
publish-to-maven-central:
9+
steps:
10+
- id: install-secret-key
11+
name: Install gpg secret key
12+
run: |
13+
# Install gpg secret key
14+
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
15+
# Verify gpg secret key
16+
gpg --list-secret-keys --keyid-format LONG
17+
- id: publish-to-central
18+
name: Publish to Central Repository
19+
env:
20+
MAVEN_USERNAME: ${{ vars.OSSRH_USERNAME }}
21+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
22+
run: |
23+
mvn \
24+
--no-transfer-progress \
25+
--batch-mode \
26+
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
27+
clean deploy

0 commit comments

Comments
 (0)