Skip to content

Publish

Publish #37

Workflow file for this run

name: Publish
on:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: "Set up JDK"
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: Set up GPG
run: echo -n "${GPG_PRIVATE_KEY}" | base64 --decode > ${GITHUB_WORKSPACE}/${GPG_KEY_ID}.gpg
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: "Gradle Build"
run: ./gradlew build -Pversion=${GITHUB_REF:10}
- name: "Gradle Publish"
run: |
./gradlew publishToSonatype -Pversion=${GITHUB_REF:10} \
-Psigning.keyId=${GPG_KEY_ID} \
-Psigning.password=${GPG_PASSPHRASE} \
-Psigning.secretKeyRingFile=${GITHUB_WORKSPACE}/${GPG_KEY_ID}.gpg
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}