Skip to content

Commit

Permalink
BAH-3807 | Fix. Skip build and publish workflow if build has a fixed …
Browse files Browse the repository at this point in the history
…version
  • Loading branch information
mohan-13 committed Aug 26, 2024
1 parent bb43462 commit 6948060
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build_publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and Publish package
on:
push:
branches: [ master ]
branches: [ master, BAH-3807 ]

jobs:
build-publish-package:
Expand All @@ -17,7 +17,13 @@ jobs:
server-username: NEXUS_USERNAME
server-password: NEXUS_PASSWORD
- name: Build and deploy with Maven
run: ./mvnw --no-transfer-progress clean -U deploy
run: |
PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
if [[ "$VERSION" == *"-SNAPSHOT" ]]; then
./mvnw --no-transfer-progress clean -U deploy
else
echo "❌ The current push is for release. So skipping build."
fi
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

0 comments on commit 6948060

Please sign in to comment.