Skip to content

Commit

Permalink
Issue #217: Deploy SNAPSHOTs with custom version scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
ALRubinger committed Mar 9, 2024
1 parent 6ffb31c commit 9d4db51
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,18 @@ jobs:
--settings .maven_settings.xml \
-Dversion=${{ github.event.inputs.version }}
else
# Construct a version for deployment in form X.Y.Z-commit-$shortSHA-SNAPSHOT
mvnVersion=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
longSHA=$(git rev-parse --verify HEAD)
version=$(echo "$mvnVersion" | cut -d'-' -f1)
shortSHA=$(echo "${longSHA:0:7}")
resolvedVersion="$version-commit-$shortSHA-SNAPSHOT"
# Maven Deploy
mvn \
deploy \
--batch-mode \
--settings .maven_settings.xml
--settings .maven_settings.xml \
-Dversion=$resolvedVersion
fi
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
Expand Down

0 comments on commit 9d4db51

Please sign in to comment.