Skip to content

Release

Release #45

Workflow file for this run

name: Release
on:
release:
types: [ published ]
jobs:
release:
runs-on: ubuntu-latest
env:
GIT_USER_NAME: matrei
GIT_USER_EMAIL: mattias.reichel@gmail.com
steps:
- name: --- CHECKOUT REPOSITORY ---
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: --- VALIDATE GRADLE WRAPPER ---
uses: gradle/wrapper-validation-action@v2
- name: --- SET UP JDK ---
uses: actions/setup-java@v4
with: { java-version: 11, distribution: adopt }
- name: --- GET THE RELEASE VERSION NUMBER FROM RELEASE TAG ---
id: version
uses: nowsprinting/check-version-format-action@v3
with: { prefix: v }
- name: --- GENERATE SECRING FILE ---
if: success()
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: echo "$SECRING_FILE" | base64 -d > ${{ github.workspace }}/secring.gpg
- name: --- PUBLISH TO SONATYPE OSSRH ---
if: success()
uses: gradle/gradle-build-action@v3
env:
ORG_GRADLE_PROJECT_sonatypeOssUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypeOssPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeOssStagingProfileId: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
with:
arguments: |
-Prelease=true
-Pversion=${{ steps.version.outputs.full_without_prefix }}
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publishToSonatype
closeAndReleaseSonatypeStagingRepository
- name: --- DELETE SECRING FILE ---
run: rm ${{ github.workspace }}/secring.gpg
- name: --- RUN POST-RELEASE ---
uses: matrei/github-actions/post-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
env:
RELEASE_VERSION: ${{ steps.version.outputs.full_without_prefix }}
SNAPSHOT_SUFFIX: -SNAPSHOT