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
name: Publish package to the Maven Central Repository | |
# see https://docs.github.com/de/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-maven | |
on: | |
release: | |
types: [created] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.SIGN_KEY }} # has to be read directly from secrets | |
# gpg-passphrase: SIGN_KEY_PASS # deprecated default name used by maven-gpg-plugin | |
- name: Publish package | |
run: mvn --batch-mode deploy | |
# run: mvn -V --errors --show-version --batch-mode --no-transfer-progress -Ddoclint=all deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGN_KEY_PASS }} |