Skip to content

Release

Release #72

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
versionModifier:
description: "Version Modifier"
default: "minor"
type: choice
required: true
options:
- "patch"
- "minor"
- "major"
skipPublishing:
description: "Skip artifact publishing"
required: false
type: boolean
default: false
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set defaults for Build Parameters
id: build_parameters
shell: bash
run: |
if [ "$SKIP_PUBLISH" = "true" ]; then
echo 'SKIPPING publish'
else
echo 'publishing!'
echo "publishCommand=publishPlugins" >> $GITHUB_OUTPUT
fi
if [ ${{ github.ref }} != 'refs/heads/main' ]; then
echo 'SKIPPING github release since this is a branch release'
else
echo 'not skipping github release'
echo "githubReleaseCommand=githubRelease" >> $GITHUB_OUTPUT
fi
env:
SKIP_PUBLISH: ${{ github.event.inputs.skipPublishing }}
- name: Install gpg secret key
run: |
export GPG_TTY=$(tty)
echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode > release.gpg
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
gradle-home-cache-cleanup: true
gradle-home-cache-includes: |
caches
notifications
jdks
wrapper
- name: Build and Release Main
run: |
./gradlew \
-Psemver.modifier=${{ github.event.inputs.versionModifier }} \
build ${{ steps.build_parameters.outputs.publishCommand }} \
${{ steps.build_parameters.outputs.githubReleaseCommand }} \
-Psigning.keyId=${{ secrets.OSSRH_GPG_SECRET_KEY_ID }} \
-Psigning.password=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
-Psigning.secretKeyRingFile=release.gpg \
-Pgradle.publish.key=${{ secrets.OSS_GRADLE_PUBLISH_KEY }} \
-Pgradle.publish.secret=${{ secrets.OSS_GRADLE_PUBLISH_SECRET }} \
--stacktrace \
--parallel \
--build-cache