Skip to content

Commit

Permalink
Fix release workflow (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karasiq authored Jul 12, 2021
1 parent ea28bd6 commit a20a8cb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/mvn-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Publish packages to OSSRH

on:
push:
branches:
branches:
- master
- version-[0-9].[0-9]+.x
tags:
tags:
- v[0-9].[0-9]+.[0-9]+
pull_request:

Expand All @@ -27,9 +27,11 @@ jobs:
mvn_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
git_ref=${GITHUB_REF##*/}
pr_number=${{ github.event.number }}
if [[ $git_ref =~ v[0-9]+\.[0-9]+\.[0-9]+$ && v$mvn_version != $git_ref ]] ; then
echo Maven version $mvn_version does not match tag $git_ref
exit 1
if [[ $git_ref =~ v[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then
if [[ v$mvn_version != $git_ref ]] ; then
echo Maven version $mvn_version does not match tag $git_ref
exit 1
fi
elif [[ $pr_number != "" && $mvn_version =~ -SNAPSHOT$ ]] ; then
pattern="s/(.+)-SNAPSHOT/\1-"$pr_number"-SNAPSHOT/g"
mvn_version=$(echo $mvn_version | sed -E $pattern)
Expand Down

0 comments on commit a20a8cb

Please sign in to comment.