Skip to content

Commit

Permalink
Fix release: use GITHUB_REF_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Chédru authored Jan 26, 2023
1 parent 150bce2 commit c09c637
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,21 @@ jobs:
with:
distribution: 'zulu'
java-version: '8'
- name: get tag
id: get_tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: maven build
env:
TAG: ${{ steps.get_tag.outputs.tag }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
if echo "${TAG}" | egrep '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?$'
if echo "${GITHUB_REF_NAME}" | egrep '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?$'
then
# the tag looks like a version number: proceed with release
echo ${GPG_SECRET_KEY} | base64 --decode | gpg --import --no-tty --batch --yes
echo ${GPG_OWNERTRUST} | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes
mvn -ntp versions:set -DnewVersion=${TAG}
mvn -ntp versions:set -DnewVersion=${GITHUB_REF_NAME}
mvn -ntp -s .github/settings.xml -Prelease deploy jacoco:report coveralls:report -DrepoToken=${COVERALLS_TOKEN}
else
# this is a regular build
Expand Down

0 comments on commit c09c637

Please sign in to comment.