Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
janolaveide authored Jan 17, 2020
1 parent 8230baf commit 3c9af59
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,29 @@ jobs:
- name: Hent tag
run: echo "::set-env name=TAG::$(git log -1 --pretty='%ad' --date=format:'%Y%m%d%H%M%S')-$(echo $GITHUB_SHA | cut -c1-7)"

- name: Hent maven version
run: |
echo "::set-env name=MVN_VERSION::$(mvn help:evaluate -Dsha1=${TAG} -Dexpression=project.version -q -DforceStdout)"
- name: Build artifacts & deploy
shell: bash
run: |
mvn versions:set -DnewVersion=${MVN_VERSION}
mvn --quiet jacoco:prepare-agent deploy jacoco:report sonar:sonar -e --batch-mode --settings ./.github/.m2/settings.xml -Dsha1=${TAG} -Dsonar.login=${SONAR_TOKEN} -Djacoco.destFile=$(pwd)/target/jacoco.exec
env:
GITHUB_USERNAME: x-access-token
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.MVN_VERSION }}
release_name: Release ${{ env.MVN_VERSION }}
draft: false
prerelease: false

0 comments on commit 3c9af59

Please sign in to comment.