Skip to content

Publish to Maven Central #55

Publish to Maven Central

Publish to Maven Central #55

Workflow file for this run

name: Publish to Nexus
on:
release:
types: [published]
permissions:
actions: write
checks: write
contents: write
deployments: read
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
security-events: write
statuses: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: maven
server-id: nexus-releases
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish package
env:
MAVEN_USERNAME: ${{ secrets.OSS_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }}
run: |
MAVEN_USERNAME=$MAVEN_USERNAME MAVEN_PASSWORD=$MAVEN_PASSWORD
MAVEN_GPG_PASSPHRASE=$MAVEN_GPG_PASSPHRASE
mvn --no-transfer-progress --batch-mode deploy -P release-sign-artifacts