Skip to content

Commit

Permalink
Set up GitHub action for deploying to Maven Central on new tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarsotovalero committed Sep 19, 2022
1 parent 2ad28fb commit 8eb4f57
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: build

name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
# For maven project
build:
strategy:
max-parallel: 1
matrix:
os: [ ubuntu-latest, windows-latest ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
java: [ 17 ]
runs-on: ${{ matrix.os }}
name: Maven Build with Java ${{ matrix.java }} on ${{ matrix.os }}
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy to the Maven Central Repository
on:
release:
types: [ created ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Install Java and Maven
uses: actions/setup-java@v3
with:
java-version: 17

- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.nexus_password }}

0 comments on commit 8eb4f57

Please sign in to comment.