-
-
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.
- Loading branch information
Showing
5 changed files
with
147 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
- name: Cache SonarCloud packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.sonar/cache | ||
key: ${{ runner.os }}-sonar | ||
restore-keys: ${{ runner.os }}-sonar | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Build and analyze | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Bump POM | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
bump_pom: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
- name: Expose git commit data | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Bump pom patch version for fixes and clean | ||
run: | | ||
mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DprocessAllModules versions:commit | ||
if: "contains(env.GIT_COMMIT_MESSAGE_SUBJECT , 'Merge pull request') && | ||
(contains(env.GIT_COMMIT_MESSAGE_SUBJECT , 'fix') || contains(env.GIT_COMMIT_MESSAGE_SUBJECT , 'clean'))" | ||
|
||
- name: Bump pom minor version for feature | ||
run: | | ||
mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0 -DprocessAllModules versions:commit | ||
if: "contains(env.GIT_COMMIT_MESSAGE_SUBJECT , 'Merge pull request') && contains(env.GIT_COMMIT_MESSAGE_SUBJECT , 'feature')" | ||
|
||
- name: Bump pom major version for major feature | ||
run: | | ||
mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0 -DprocessAllModules versions:commit | ||
if: "contains(env.commit_message, 'Merge pull request') && | ||
(contains(env.GIT_COMMIT_MESSAGE_SUBJECT , 'clean') || contains(env.GIT_COMMIT_MESSAGE_SUBJECT , 'major'))" | ||
- name: Retrieve the version | ||
run: | | ||
echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | ||
- name: Commit and tag | ||
uses: EndBug/[email protected] | ||
with: | ||
add: "['pom.xml', './**/pom.xml']" | ||
default_author: github_actions | ||
message: Bump pom | ||
tag: ${{ env.version }} | ||
if: "contains(env.commit_message, 'Merge pull request')" |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Deploy to maven repository after bump pom | ||
|
||
on: | ||
push: | ||
tags: | ||
- "\d.\d.\d" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == '' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '11' | ||
|
||
- name: Publish to Apache Maven Central | ||
run: mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent -DskipTests deploy sonar:sonar --settings .settings.xml -P release,ossrh | ||
env: | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Upload the Jars | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: /**/target/*.jar | ||
|
||
# Remains upload jar artifacts | ||
# Create the release https://github.com/marketplace/actions/gh-release?version=v0.1.5 | ||
release: |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Java CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
verify: | ||
runs-on: ubuntu-latest | ||
concurrency: ci-${{ github.ref }} | ||
strategy: | ||
matrix: | ||
java: ['8', '11', '13', '15'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'adopt' | ||
- name: Cache maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Run the maven verify | ||
run: mvn --batch-mode --update-snapshots clean verify |
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