Release Libraries #8
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 Libraries | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseType: | |
description: 'Choose the release type (patch|minor|major)' | |
required: true | |
default: 'patch' | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
releaseVersion: | |
description: 'Set the release version (overrides release type)' | |
required: false | |
type: string | |
jobs: | |
build: | |
# if: contains('["renelink"]', github.actor) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Validate Workflow Inputs | |
id: validate | |
run: | | |
export RELEASE_ARG="${{ inputs.releaseVersion || inputs.releaseType }}" | |
[[ "$RELEASE_ARG" =~ ^([0-9]+.[0-9]+.[0-9]+|patch|minor|major)$ ]] || \ | |
{ echo "$RELEASE_ARG is not a valid release argument! Use ^([0-9]+.[0-9]+.[0-9]+|patch|minor|major)$ "; exit 1; } | |
echo "RELEASE_ARG=${RELEASE_ARG}" >> "$GITHUB_OUTPUT" | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies. | |
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 | |
- name: Configure Git User | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email github-actions[bot]@users.noreply.github.com | |
- name: Build with Gradle Wrapper | |
run: | | |
./.bin/gradlew_release ${{ steps.validate.outputs.RELEASE_ARG }} | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.PUSH_TOKEN}} |