-
Notifications
You must be signed in to change notification settings - Fork 14
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
8 changed files
with
157 additions
and
92 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,66 @@ | ||
name: Build | ||
|
||
on: | ||
[push] | ||
|
||
jobs: | ||
build: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
#This check is case insensitive | ||
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" | ||
outputs: | ||
# Get from step "setversion" | ||
artifact-version: ${{ steps.setversion.outputs.version }} | ||
env: | ||
BUILD_VERSION: SNAPSHOT | ||
# Name of the project; used in multiple steps (e.g. for upload) | ||
PROJECT_NAME: fuse-nio-adapter | ||
steps: | ||
# Foreign Action: Checkout the current commit | ||
- uses: actions/checkout@v2 | ||
# Foreign Action: Setup Java Runtime Environment | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
server-id: bintray-jcenter | ||
server-username: BINTRAY_USERNAME # Defined in step "deploytojcenter" | ||
server-password: BINTRAY_API_KEY # See above | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Ensure to use tagged version | ||
id: taggedVersion | ||
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/} | ||
if: startsWith(github.ref, 'refs/tags/') # Run if ref is tagged (e.g. "v.1.4") | ||
- name: Export the project version to the job environment and fix it as an ouput of this step | ||
id: setVersion # Output used above (outputs.artifact-version) | ||
run: | | ||
v=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout) | ||
echo "BUILD_VERSION=${v}" >> $GITHUB_ENV | ||
echo "::set-output name=version::${v}" | ||
- name: Build and Test | ||
id: buildAndTest | ||
run: mvn -B clean install jacoco:report -Pcoverage,dependency-check | ||
- name: Upload code coverage report | ||
id: codacyCoverageReporter | ||
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) | ||
env: | ||
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
continue-on-error: true | ||
- name: Upload snapshot artifact ${{ env.PROJECT_NAME }}-${{ env.BUILD_VERSION }}.jar | ||
id: uploadSnapshot | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.PROJECT_NAME }}-${{ env.BUILD_VERSION }}.jar | ||
path: target/${{ env.PROJECT_NAME }}-*.jar | ||
- name: Deploy to jcenter | ||
id: deployToJcenter | ||
run: mvn -B deploy -Prelease -DskipTests | ||
if: startsWith(github.ref, 'refs/tags/') # Run if ref is tagged (e.g. "v.1.4") | ||
env: | ||
BINTRAY_USERNAME: cryptobot | ||
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }} |
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 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 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
Oops, something went wrong.