Skip to content

Commit 6891c7b

Browse files
author
Thierry Boileau
committed
Publish to Maven Central with manual publish
1 parent e5483c8 commit 6891c7b

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish package to Central
2+
on:
3+
release:
4+
types: [ created ]
5+
workflow_dispatch:
6+
concurrency:
7+
group:
8+
${{ github.repository }}-${{ github.workflow }}-${{ github.event.number || github.head_ref || github.run_id || github.sha }}
9+
cancel-in-progress: true
10+
env:
11+
JAVA_VERSION: 8
12+
jobs:
13+
publish-central:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up JDK ${{ env.JAVA_VERSION }} for publishing to Maven Central Repository
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: 'temurin'
24+
java-version: ${{ env.JAVA_VERSION }}
25+
cache: 'maven'
26+
server-id: ossrh
27+
server-username: MAVEN_USERNAME
28+
server-password: MAVEN_PASSWORD
29+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
30+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
31+
- name: Publish to the Maven Central Repository
32+
run: ./mvnw clean --batch-mode -P default,ossrh -Dpublish=ossrh deploy
33+
env:
34+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
35+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
36+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)