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 fa303ee commit 161779d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@ jobs:
java-version: 1.11

- 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: |
echo "::set-env name=MVN_VERSION::$(mvn help:evaluate -Dsha1=${TAG} -Dexpression=project.version -q -DforceStdout)"
mvn --quiet jacoco:prepare-agent deploy -e --batch-mode --settings ./.github/.m2/settings.xml -Dsha1=${TAG} -Dsonar.login=${SONAR_TOKEN} -Djacoco.destFile=$(pwd)/target/jacoco.exec
mvn jacoco:report sonar:sonar -e --batch-mode --settings .github/.m2/settings.xml -Dsha1=${TAG} -Djacoco.dataFile=$(pwd)/target/jacoco.exec -Dsonar.login=${SONAR_TOKEN}
mvn versions:set -DnewVersion=${MVN_VERSION}
mvn --quiet jacoco:prepare-agent deploy -e --batch-mode --settings ./.github/.m2/settings.xml -Dsonar.login=${SONAR_TOKEN} -Djacoco.destFile=$(pwd)/target/jacoco.exec
mvn jacoco:report sonar:sonar -e --batch-mode --settings .github/.m2/settings.xml -Djacoco.dataFile=$(pwd)/target/jacoco.exec -Dsonar.login=${SONAR_TOKEN}
mvn versions:revert
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: x-access-token
Expand Down

0 comments on commit 161779d

Please sign in to comment.