Skip to content

Maven Central Repo Deployment #33

Maven Central Repo Deployment

Maven Central Repo Deployment #33

Workflow file for this run

name: Maven Central Repo Deployment
on:
release:
types: [released, prereleased]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Git Repo
uses: actions/checkout@v2
- name: Set up Maven Central Repo
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
server-id: ossrh
server-username: 'OSSRH_USER'
server-password: 'OSSRH_PASSWORD'
gpg-passphrase: 'GPG_PASSWORD'
gpg-private-key: ${{ secrets.GPG_SECRET }}
- name: debug settings.xml
run: cat /home/runner/.m2/settings.xml
- name: debug echo
run: echo $GPG_SECRET
env:
GPG_SECRET: ${{ secrets.GPG_SECRET }}
- name: Write gpg key
run: echo $GPG_SECRET >> /home/runner/private-key.txt
env:
GPG_SECRET: ${{ secrets.GPG_SECRET }}
- name: Import gpg key
run: gpg --import --batch /home/runner/private-key.txt
- name: Publish to Maven Central Repo
run: mvn clean deploy --batch-mode --activate-profiles deploy
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}