generated from creek-service/multi-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.7 KB
/
version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0
with:
gradle-home-cache-cleanup: true
- 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 }}