Enable release signing #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish tagged artifacts to Maven Central | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build: | |
name: "Publish tagged artifacts to Maven Central" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: set up JDK 17 | |
uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Publish artifact | |
env: | |
SIGNING_KEY_ARMOR: ${{ secrets.MAVEN_SIGNING_KEY_ARMOR_BASE64 }} | |
SIGNING_KEY_ID: ${{ secrets.MAVEN_SIGNING_KEY_ID }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.MAVEN_SIGNING_KEY_PASSPHRASE }} | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
run: | | |
echo "Create .gpg key from secret" | |
echo $SIGNING_KEY_ARMOR | base64 --decode > ./signingkey.asc | |
gpg --quiet --output $GITHUB_WORKSPACE/signingkey.gpg --dearmor ./signingkey.asc | |
./gradlew publish -Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/signingkey.gpg -Psigning.password=$SIGNING_KEY_PASSWORD -Psigning.keyId=$SIGNING_KEY_ID -PmavenCentralUsername=$OSSRH_USERNAME -PmavenCentralPassword=$OSSRH_PASSWORD | |
- name: Close and release Sonatype repository | |
if: ${{ success() }} | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
run: ./gradlew closeAndReleaseRepository -PmavenCentralUsername=$OSSRH_USERNAME -PmavenCentralPassword=$OSSRH_PASSWORD |