Release #41
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- name: --- VALIDATE GRADLE WRAPPER --- | |
uses: gradle/wrapper-validation-action@v1 | |
- 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@v2 | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} | |
SECRING_FILE: ${{ secrets.SECRING_FILE }} | |
RELEASE_VERSION: ${{ steps.version.outputs.full_without_prefix }} | |
with: | |
arguments: -Prelease=true -Pversion=${RELEASE_VERSION} -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository | |
- name: --- DELETE SECRING FILE --- | |
run: rm ${{ github.workspace }}/secring.gpg | |
- name: --- BUMP PATCH VERSION BY ONE --- | |
uses: actions-ecosystem/action-bump-semver@v1 | |
id: bump_semver | |
with: | |
current_version: ${{ steps.version.outputs.full_without_prefix }} | |
level: patch | |
- name: --- UPDATE PROJECT WITH NEW SNAPSHOT VERSION --- | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: snapshotVersion -Pversion=${{ steps.bump_semver.outputs.new_version }} | |
- name: --- COMMIT & PUSH THE NEW SNAPSHOT VERSION --- | |
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 # v1.4 | |
with: | |
branch: ${{ github.ref_name }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
author_name: ${{ secrets.GIT_USER_NAME }} | |
author_email: ${{ secrets.GIT_USER_EMAIL }} | |
message: "Next development version: ${{ steps.bump_semver.outputs.new_version }}-SNAPSHOT" |