Skip to content

Release and publish #18

Release and publish

Release and publish #18

Workflow file for this run

name: Release and publish
on:
workflow_dispatch:
inputs:
updateStrategy:
description: 'Version bump to use'
required: true
default: 'Patch'
type: choice
options:
- Patch
- Minor
- Major
jobs:
release-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Create release
run: ./gradlew release -Prelease.versionIncrementer=increment${{ inputs.updateStrategy }}
- name: publish
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRING: ${{ secrets.SIGNING_SECRING }}
run: |
echo "signing.keyId=$SIGNING_KEY_ID" > ~/.gradle/gradle.properties
echo "signing.password=$SIGNING_PASSWORD" >> ~/.gradle/gradle.properties
echo "signing.secretKeyRingFile=$HOME/.gradle/secring.gpg" >> ~/.gradle/gradle.properties
echo "$SIGNING_SECRING" | base64 -d > ~/.gradle/secring.gpg
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository