Skip to content

Commit ea1ad46

Browse files
only deploy SNAPSHOTs unless tagged
1 parent c2892b2 commit ea1ad46

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ jobs:
5959
run: |
6060
PROJECT_VERSION=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
6161
test "$PROJECT_VERSION" = "${GITHUB_REF##*/}"
62+
- name: Verify project version is -SNAPSHOT
63+
if: startsWith(github.ref, 'refs/tags/') == false
64+
run: |
65+
PROJECT_VERSION=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
66+
test "${PROJECT_VERSION: -9}" = "-SNAPSHOT"
6267
- name: Deploy to Maven Central
6368
run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
6469
env:
@@ -87,6 +92,11 @@ jobs:
8792
run: |
8893
PROJECT_VERSION=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
8994
test "$PROJECT_VERSION" = "${GITHUB_REF##*/}"
95+
- name: Verify project version is -SNAPSHOT
96+
if: startsWith(github.ref, 'refs/tags/') == false
97+
run: |
98+
PROJECT_VERSION=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
99+
test "${PROJECT_VERSION: -9}" = "-SNAPSHOT"
90100
- name: Deploy to GitHub Packages
91101
run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress
92102
env:

0 commit comments

Comments
 (0)