Skip to content

Publish Release

Publish Release #1

name: Publish Release
on:
workflow_dispatch:
jobs:
publish-release:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Ensure this isn't a -SNAPSHOT version
run: |
VERSION=$(./gradlew -q printVersion | tail -1)
if [[ $VERSION == *"-SNAPSHOT" ]]; then
echo "Cannot publish a SNAPSHOT version ($VERSION) as a release"
exit 1
fi
echo "Publishing version: $VERSION"
- name: Assemble
run: ./gradlew assemble
- name: Check
run: ./gradlew check
- name: Publish Release
run: ./gradlew publishToMavenCentral
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}