Skip to content

Release

Release #69

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@v3
with:
java-version: '17'
distribution: 'zulu'
- name: Checkout
uses: actions/checkout@v3
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: Build and Release Main
uses: gradle/gradle-build-action@v2
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
gradle-home-cache-cleanup: true
gradle-home-cache-includes: |
caches
notifications
jdks
wrapper
arguments: |
-Psemver.modifier=${{ github.event.inputs.versionModifier }}
clean 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