Skip to content

Publish packages

Publish packages #18

Workflow file for this run

name: Publish packages
on: [ release ]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Get gpg keys
run: |
echo '${{secrets.MVN_GPG_ENCRYPTED}}' | base64 -d > publish_key.gpg
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.MVN_GPG_PASS}}" \
--output secret.gpg publish_key.gpg
- name: Get release version
run: echo "::set-env name=RELEASE_VERSION::${GITHUB_REF:11}"
- name: Publish gradle
run: ./gradlew publish -Psigning.keyId=${{secrets.MVN_GPG_KEYID}} -Psigning.secretKeyRingFile=secret.gpg -Psigning.password=${{secrets.MVN_GPG_PASS}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}