Skip to content

Set next version (Minor) #20

Set next version (Minor)

Set next version (Minor) #20

Workflow file for this run

# A Workflow for adjusting the version number of the next release
name: Set next version
run-name: Set next version (${{ inputs.part }})
on:
workflow_dispatch:
inputs:
part:
description: "Part to increment: Major, Minor, Patch or the next release, e.g. 1.2.3"
required: true
default: Minor
permissions:
contents: read
concurrency: "${{ github.repository }}-versioning"
jobs:
version:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ secrets.TRIGGER_GITHUB_TOKEN }}
- name: Fetch version history
run: git fetch --tags --unshallow
- name: Set up JDK
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
java-version: '16'
distribution: 'adopt'
cache: gradle
- name: Increment version
if: contains(fromJson('["Major", "Minor", "Patch"]'), github.event.inputs.part)
run: |
# The following command will trigger the build.yml workflow as it pushes a alpha tag
./gradlew markNextVersion -Prelease.incrementer=increment${{ github.event.inputs.part }}
- name: Set next version
if: (!contains(fromJson('["Major", "Minor", "Patch"]'), github.event.inputs.part))
run: |
# The following command will trigger the build.yml workflow as it pushes a alpha tag
./gradlew markNextVersion -Prelease.version=${{ github.event.inputs.part }}