Skip to content

Commit 8f9f9ed

Browse files
dfa1claude
andcommitted
ci: add publish workflow for Maven Central
Triggers on v* tags. Uses actions/setup-java server-id=central with CENTRAL_USERNAME/CENTRAL_PASSWORD/GPG_PRIVATE_KEY/GPG_PASSPHRASE secrets from the maven-central environment. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6b026f7 commit 8f9f9ed

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to Maven Central
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
environment: maven-central
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up JDK 25 with Maven Central publishing
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '25'
22+
distribution: 'zulu'
23+
cache: 'maven'
24+
server-id: central
25+
server-username: CENTRAL_USERNAME
26+
server-password: CENTRAL_PASSWORD
27+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
28+
gpg-passphrase: GPG_PASSPHRASE
29+
30+
- name: Publish to Maven Central
31+
env:
32+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
33+
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
34+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
35+
run: ./mvnw deploy -Prelease -DskipTests --batch-mode

0 commit comments

Comments
 (0)