Skip to content

Commit 6e7de2f

Browse files
committed
👷 Added GH Action for publishing release
1 parent 14c5a4a commit 6e7de2f

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/maven-build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Maven Build
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up JDK
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
cache: maven
25+
26+
- name: Build with Maven
27+
run: mvn -B package --file pom.xml

.github/workflows/maven-publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Maven Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up JDK
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
cache: maven
23+
server-id: central
24+
server-username: CENTRAL_USERNAME
25+
server-password: CENTRAL_PASSWORD
26+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
27+
28+
- name: Build with Maven
29+
run: mvn -B package --file pom.xml
30+
31+
- name: Publish to Maven Central
32+
run: mvn deploy
33+
env:
34+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
35+
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
36+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)