.github/workflows/maven-central.yaml #87
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://docs.github.com/en/actions/publishing-packages/publishing-java-packages-with-maven#publishing-packages-to-the-maven-central-repository | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
publish: | |
name: publish to Maven Central | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version-file: .tool-versions | |
distribution: oracle | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
- name: Publish package | |
# For some reason this has to be `mvn` | |
# Changing it to `./mvnw` breaks the nexus-staging-maven-plugin in a way where it only runs once, not once per module | |
run: mvn --activate-profiles deploy,maven-javadoc-plugin deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |