Skip to content

Add missing github refname in publish workflow #11

Add missing github refname in publish workflow

Add missing github refname in publish workflow #11

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 publishToMavenCentral -Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/signingkey.gpg -Psigning.password=$SIGNING_KEY_PASSWORD -Psigning.keyId=$SIGNING_KEY_ID -PmavenCentralUsername=$OSSRH_USERNAME -PmavenCentralPassword=$OSSRH_PASSWORD -PgithubRefName=${{ github.ref_name }}
- name: Close and release Sonatype repository
if: ${{ success() }}
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew releaseRepository -PmavenCentralUsername=$OSSRH_USERNAME -PmavenCentralPassword=$OSSRH_PASSWORD