-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAH-4087 | Add. Workflow for release deploy (#157)
- Loading branch information
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Build and Release package | ||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
build-release-package: | ||
name: Build and Release package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
server-id: nexus-sonatype | ||
server-username: NEXUS_USERNAME | ||
server-password: NEXUS_PASSWORD | ||
gpg-private-key: ${{ secrets.BAHMNI_INFRA_GPG_KEY }} | ||
- name: Compare Git tag with Maven version | ||
run: | | ||
export GIT_TAG=${GITHUB_REF#refs/tags/} | ||
PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
if [ "$PROJECT_VERSION" != "$GIT_TAG" ]; then | ||
echo "❌ The Git tag ($GIT_TAG) does not match the Maven version ($PROJECT_VERSION)." | ||
exit 1 | ||
else | ||
echo "✅ The Git tag matches the Maven version." | ||
fi | ||
- name: Build and deploy with Maven | ||
run: ./mvnw --no-transfer-progress clean -U deploy -DperformRelease=true | ||
env: | ||
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} | ||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} | ||
GPG_PASSPHRASE: ${{ secrets.BAHMNI_INFRA_GPG_PASSPHRASE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters