Merge pull request #514 from mivek/feature/Gusts_3_digits #47
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: Bump POM | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
bump: | |
if: ${{ startsWith(github.event.head_commit.message, 'Merge pull request') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.CHECKOUT_TOKEN }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
cache: 'maven' | |
- name: Update major version when it is a major feature | |
run: > | |
mvn build-helper:parse-version versions:set | |
-DnewVersion="\${parsedVersion.nextMajorVersion}.0.0" | |
-DprocessAllModules versions:commit | |
if: ${{ contains(github.event.head_commit.message, 'major/') }} | |
- name: Update minor version when it is a feature | |
run: > | |
mvn build-helper:parse-version versions:set | |
-DnewVersion="\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0" | |
-DprocessAllModules versions:commit | |
if: ${{ contains(github.event.head_commit.message, 'feature/') }} | |
- name: Update patch version in case of bugfix or dependencies upgrade | |
run: > | |
mvn build-helper:parse-version versions:set | |
-DnewVersion="\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}" | |
-DprocessAllModules versions:commit | |
if: ${{ contains(github.event.head_commit.message, 'fix/') || contains(github.event.head_commit.message, 'clean/') || contains(github.event.head_commit.message, 'dependencies')}} | |
- name: Retrieve the new version | |
id: get-version | |
uses: JActions/maven-version@v1.2.0 | |
- name: Commit and tag the new version | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Automatic bump after merge" | |
file_pattern: pom.xml **/pom.xml | |
commit_author: Github Action <actions@github.com> | |
commit_user_name: github-actions | |
create_branch: false | |
tagging_message: ${{ steps.get-version.outputs.version }} |