Skip to content

Commit 09b81e9

Browse files
committed
Add github action for releasing to maven central repository
1 parent 5b2af7c commit 09b81e9

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

.github/workflows/build.yml renamed to .github/workflows/build_and_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Java CI with Maven
1+
name: Build and deploy releases to GitHub
22

33
on:
44
push:
@@ -34,7 +34,7 @@ jobs:
3434
steps:
3535
- name: Checkout code
3636
uses: actions/checkout@v2
37-
- name: Create Release
37+
- name: Create GitHub Release
3838
id: create_release
3939
uses: actions/create-release@v1
4040
env:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release to Maven central repository
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out Git repository
13+
uses: actions/checkout@v2
14+
15+
- name: Install Java and Maven
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 11
19+
20+
- name: Release Maven package
21+
uses: samuelmeuli/action-maven-publish@v1
22+
with:
23+
maven_args: -D=skipTests=true
24+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
25+
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
26+
nexus_username: ${{ secrets.NEXUS_USERNAME }}
27+
nexus_password: ${{ secrets.NEXUS_PASSWORD }}

0 commit comments

Comments
 (0)