Skip to content

Release

Release #6

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: Bump Version
default: 1.0.0
required: true
tweet:
description: extra text for tweet
required: false
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- uses: gradle/gradle-build-action@v2
name: Build with Gradle
with:
arguments: build
- name: Identify current version
id: current_version
uses: christian-draeger/read-properties@1.0.1
with:
path: './gradle.properties'
property: 'version'
- name: Write new version
uses: christian-draeger/write-properties@1.0.1
with:
path: './gradle.properties'
property: 'version'
value: ${{ github.event.inputs.version }}
- name: Find and Replace version reference in all readme files of the repo
uses: jacobtomlinson/gha-find-replace@v2
with:
find: ${{ steps.current_version.outputs.value }}
replace: ${{ github.event.inputs.version }}
include: "README.md" # Will match all README.md files in any nested directory
# deactivate for now since commit action is not able to push changes in workflow files because of missing permission
# - name: Update github action release workflow default version
# uses: fjogeleit/yaml-update-action@v0.3.0
# with:
# valueFile: '.github/workflows/release.yml'
# propertyPath: 'on.workflow_dispatch.inputs.version.default'
# commitChange: 'false'
# updateFile: 'true'
# value: ${{ github.event.inputs.version }}
- uses: gradle/gradle-build-action@v2
name: Publish to Maven Central
env:
ORG_GRADLE_PROJECT_signingKey: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_signingKeyId: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID}}
ORG_GRADLE_PROJECT_signingPassword: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME}}
ORG_GRADLE_PROJECT_sonatypePassword: ${{secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD}}
with:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
# - name: Deploy docs
# uses: mhausenblas/mkdocs-deploy-gh-pages@master
# # Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# #CUSTOM_DOMAIN: optionaldomain.com
# CONFIG_FILE: mkdocs.yml
# #EXTRA_PACKAGES: build-base
# # GITHUB_DOMAIN: github.myenterprise.com
# #REQUIREMENTS: folder/requirements.txt
- uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: master
commit_user_name: manosbatsis
commit_user_email: manosbatsis@gmail.com
commit_author: manosbatsis <manosbatsis@gmail.com>
commit_message: bump version ${{ steps.current_version.outputs.value }} --> ${{ github.event.inputs.version }}
- name: Create Tag
uses: negz/create-tag@v1
with:
version: ${{ github.event.inputs.version }}
message: ${{ github.event.inputs.version.description }}
token: ${{ secrets.GITHUB_TOKEN }}