From 3c9af59294ba65243b3438a8be4058f06bf8c310 Mon Sep 17 00:00:00 2001 From: Jan-Olav Eide Date: Fri, 17 Jan 2020 13:23:47 +0100 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da1b0a8..22dcba4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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