Release #5
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: | |
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/[email protected] | |
with: | |
path: './gradle.properties' | |
property: 'version' | |
- name: Write new version | |
uses: christian-draeger/[email protected] | |
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/[email protected] | |
# 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: [email protected] | |
commit_author: manosbatsis <[email protected]> | |
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 }} | |