Skip to content

v1.0.0 - First release #12

v1.0.0 - First release

v1.0.0 - First release #12

name: Java Maven Library Publisher
# Based on "Mathieu Soysal (@MathieuSoysal)"
on:
release:
types: [ created ]
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK for deploy to OSSRH
uses: actions/setup-java@v3.13.0
with:
distribution: "zulu"
java-version: 21
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Prepare Maven environment with Java for deployment to OSSRH
run: export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
shell: bash
- name: Publish to Apache Maven Central
run: mvn deploy -PossrhDeploy
shell: bash
env:
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}