Skip to content

Publish packages

Publish packages #25

Workflow file for this run

name: Publish packages
on:
release:
types:
- published
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 "name=RELEASE_VERSION::${GITHUB_REF:11}" >> "$GITHUB_ENV"
echo "Using version $RELEASE_VERSION"
- name: Publish gradle
run: ./gradlew publish -Psigning.keyId=${{secrets.MVN_GPG_KEYID}} -Psigning.secretKeyRingFile=$(pwd)/secret.gpg -Psigning.password=${{secrets.MVN_GPG_PASS}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}