Skip to content

Commit 09bcd07

Browse files
use tag as version when deploying
1 parent 95d0094 commit 09bcd07

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,9 @@ jobs:
5454
server-id: central
5555
server-username: MAVEN_CENTRAL_USERNAME
5656
server-password: MAVEN_CENTRAL_PASSWORD
57-
- name: Verify project version matches tag
57+
- name: Ensure to use tagged version
5858
if: startsWith(github.ref, 'refs/tags/')
59-
run: |
60-
PROJECT_VERSION=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
61-
test "$PROJECT_VERSION" = "${GITHUB_REF##*/}"
59+
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
6260
- name: Verify project version is -SNAPSHOT
6361
if: startsWith(github.ref, 'refs/tags/') == false
6462
run: |
@@ -87,11 +85,9 @@ jobs:
8785
java-version: ${{ env.JAVA_VERSION }}
8886
distribution: 'temurin'
8987
cache: 'maven'
90-
- name: Verify project version matches tag
88+
- name: Ensure to use tagged version
9189
if: startsWith(github.ref, 'refs/tags/')
92-
run: |
93-
PROJECT_VERSION=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
94-
test "$PROJECT_VERSION" = "${GITHUB_REF##*/}"
90+
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
9591
- name: Verify project version is -SNAPSHOT
9692
if: startsWith(github.ref, 'refs/tags/') == false
9793
run: |

0 commit comments

Comments
 (0)