Skip to content

Commit 36f163b

Browse files
committed
Add GitHub workflow to publish on Maven central
1 parent 8eff5bb commit 36f163b

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish to Maven Central
2+
on:
3+
release:
4+
types: [published]
5+
6+
defaults:
7+
run:
8+
shell: bash
9+
10+
jobs:
11+
publish:
12+
runs-on: windows-latest
13+
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-java@v3
17+
with:
18+
distribution: 'temurin'
19+
java-version: 19
20+
cache: 'maven'
21+
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
22+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
23+
- name: Enforce project version ${{ github.event.release.tag_name }}
24+
run: mvn versions:set -B -DnewVersion="${{ github.event.release.tag_name }}"
25+
- name: Deploy
26+
run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)