Skip to content

Commit 0a63bf4

Browse files
committed
Replace test workflow with CI & Publish workflow
Supports tag-triggered Maven Central releases via the existing release profile. Old test-only workflow removed.
1 parent ac2a754 commit 0a63bf4

File tree

2 files changed

+55
-18
lines changed

2 files changed

+55
-18
lines changed

.github/workflows/ci-publish.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI & Publish
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up JDK 25 (Azul Zulu)
19+
if: "!startsWith(github.ref, 'refs/tags/v')"
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: zulu
23+
java-version: '25'
24+
cache: maven
25+
26+
- name: Set up JDK 25 (Azul Zulu) for Maven Central
27+
if: startsWith(github.ref, 'refs/tags/v')
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: zulu
31+
java-version: '25'
32+
cache: maven
33+
server-id: central
34+
server-username: CENTRAL_USERNAME
35+
server-password: CENTRAL_TOKEN
36+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
37+
gpg-passphrase: GPG_PASSPHRASE
38+
39+
- name: Set release version from tag
40+
if: startsWith(github.ref, 'refs/tags/v')
41+
run: |
42+
VERSION=${GITHUB_REF_NAME#v}
43+
echo "Publishing version: $VERSION"
44+
mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false
45+
46+
- name: Build and test
47+
run: mvn verify
48+
49+
- name: Publish to Maven Central
50+
if: startsWith(github.ref, 'refs/tags/v')
51+
run: mvn deploy -Prelease -DskipTests
52+
env:
53+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
54+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
55+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.github/workflows/main.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)