File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -31,17 +31,22 @@ jobs:
3131 git config --global user.name "github-actions"
3232 git config --global user.email "github-actions@github.com"
3333
34- STAGING_BRANCH="staging"
3534 # Clone the target branch for deployment
36- git clone --branch "$STAGING_BRANCH" "https://${GH_ACTOR}:${GH_TOKEN}@github.com/${GH_SNAPSHOTS_REPO}.git" target-branch
37-
35+ git clone --branch main "https://${GH_ACTOR}:${GH_TOKEN}@github.com/${GH_SNAPSHOTS_REPO}.git" target-branch
36+
37+ # Calculate the Maven coordinates and Target Branch
38+ GROUP_ID=$(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout)
39+ ARTIFACT_ID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
40+ VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
41+ STAGING_BRANCH="staging-$GROUP_ID:$ARTIFACT_ID:$VERSION-$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")"
42+
3843 # Build the project and deploy to the local repo branch
3944 mvn clean deploy -DaltDeploymentRepository=snapshot-repo::default::file://$(pwd)/target-branch/
4045
4146 # Push the updated snapshots to the branch
4247 cd target-branch
4348 git add -A
44- git commit -m "Deploy new snapshots [skip ci] " || echo "No changes to commit"
49+ git commit -m "Deploy $GROUP_ID:$ARTIFACT_ID:$VERSION " || echo "No changes to commit"
4550 git push origin "$STAGING_BRANCH"
4651
4752 - name : Generate JaCoCo Badge
You can’t perform that action at this time.
0 commit comments