Skip to content

Publish to Maven Central #7

Publish to Maven Central

Publish to Maven Central #7

Workflow file for this run

name: Publish to Maven Central
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Configure GPG Key
run: |
mkdir ~/.gnupg
echo $GPG_KEY > ~/.gnupg/secring.gpg.b64
base64 -d ~/.gnupg/secring.gpg.b64 > ~/.gnupg/secring.gpg
- name: Deploy to Sonatype
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
MAVEN_SIGNING_KEY_ID: ${{secrets.GPG_KEY_ID}}
MAVEN_SIGNING_KEY_PASSWORD: ${{secrets.GPG_KEY_PASSWORD}}
run: |
./gradlew publishToSonatype closeAndReleaseStagingRepository --no-parallel --no-daemon -Psigning.keyId=$MAVEN_SIGNING_KEY_ID -Psigning.password=$MAVEN_SIGNING_KEY_PASSWORD -Psigning.secretKeyRingFile=$(echo ~/.gnupg/secring.gpg)