Skip to content

Workflow file for this run

name: Publish OntoUML4j to the Maven Central Repository
on:
release:
types: [ created ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
# https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven
# https://github.com/actions/setup-java
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: maven
# https://central.sonatype.org/publish/generate-portal-token/
server-id: central
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Maven Central Portal
# if autoPublish is false (see pom.xml), we need to publish manually via https://central.sonatype.com/publishing/deployments
run: mvn --batch-mode deploy
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }}