Skip to content

Commit 07e4224

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 270f9a5 + a78243a commit 07e4224

File tree

2 files changed

+52
-39
lines changed

2 files changed

+52
-39
lines changed

.github/workflows/maven-publish.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3+
4+
name: release and push to maven central repo
5+
6+
on:
7+
push:
8+
tags:
9+
- '*'
10+
workflow_dispatch:
11+
# release:
12+
# types: [created]
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Set up Java for publishing to Maven Central Repository
25+
uses: actions/setup-java@v3
26+
with:
27+
java-version: '17'
28+
distribution: 'temurin'
29+
server-id: ossrh
30+
server-username: MAVEN_USERNAME
31+
server-password: MAVEN_PASSWORD
32+
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
33+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
34+
35+
- name: build artifact
36+
run: mvn clean package
37+
38+
- name: Create Release
39+
uses: ncipollo/release-action@v1.12.0
40+
with:
41+
allowUpdates: true
42+
artifacts: "${{ github.workspace }}/target/*.jar"
43+
token: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Publish to the Maven Central Repository
46+
run: mvn --no-transfer-progress \
47+
--batch-mode \
48+
deploy
49+
env:
50+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
51+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
52+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSWORD }}

0 commit comments

Comments
 (0)