-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Travis CI to GH Actions
- Loading branch information
Showing
10 changed files
with
95 additions
and
142 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,58 @@ | ||
name: Bump POM | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
bump_pom: | ||
bump: | ||
if: ${{ startsWith(github.event.head_commit.message, 'Merge pull request') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.CHECKOUT_TOKEN }} | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
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: Expose git commit data | ||
uses: rlespinasse/[email protected] | ||
- 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: Bump pom according to commit message name | ||
run: | | ||
bash .github/workflows/scripts/bump-pom.sh | ||
- 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/') or contains(github.event.head_commit.message, 'clean/') or contains(github.event.head_commit.message, 'dependencies')}} | ||
|
||
- name: Retrieve the version | ||
run: | | ||
echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | ||
- name: Retrieve the new version | ||
id: get-version | ||
uses: jactions/maven-version@v1 | ||
|
||
- name: Commit and tag | ||
uses: EndBug/add-and-commit@v7.2.1 | ||
- name: Commit and tag the new version | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
add: "['pom.xml', './**/pom.xml']" | ||
default_author: github_actions | ||
message: Bump pom | ||
tag: ${{ env.version }} | ||
if: "contains(env.commit_message, 'Merge pull request')" | ||
commit_message: "Automatic bump after merge" | ||
file_pattern: pom.xml, **/pom.xml | ||
commit_author: Github Action <[email protected]> | ||
commit_user_name: github-actions | ||
create_branch: false | ||
tagging_message: ${{ steps.get-version.outputs.version }} |
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.