From 4ea60cb80add11e421b536c0f0554390d5b4c464 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 24 Aug 2020 23:11:43 +0200 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 900ea82..63ce499 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,8 @@ name: Java CI on: - push: - branches: - - main + release: + types: [published] jobs: build: @@ -11,13 +10,22 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up JDK 1.11 uses: actions/setup-java@v1.4.1 with: java-version: 1.11 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Update version + run: mvn versions:set -DnewVersion=${{ github.event.release.tag }} + - name: Commit + run: | + git config --global user.name 'gimlet2' + git config --global user.email 'andrey.chernishov@gmail.com' + git commit -am "Update version" + git push + - name: Setup GPG run: echo "$GPG_KEY" | gpg --import --batch --yes env: @@ -25,7 +33,7 @@ jobs: - name: Build with Maven run: ./mvnw package site:jar source:jar --file pom.xml --no-transfer-progress - name: Publish to Github - run: ./mvnw deploy -Pgithub -Dgpg.keyname=$GPG_KEY_ID -Dgpg.passphrase=$GPG_KEY_PASS --no-transfer-progress + run: ./mvnw -X deploy -Pgithub -Dgpg.keyname=$GPG_KEY_ID -Dgpg.passphrase=$GPG_KEY_PASS --no-transfer-progress env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}