Skip to content

ci: Add Maven Central deployment on release #13

ci: Add Maven Central deployment on release

ci: Add Maven Central deployment on release #13

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
pull_request:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
java_version: [11, 17]
steps:
- uses: actions/checkout@v4
- name: Set up SDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: SIGN_KEY_PASSWORD
- name: Publish package
run: |
mvn --batch-mode \
--settings release/m2-settings.xml \
clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASS }}