File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,23 @@ git checkout -b "$RELEASE_BRANCH"
5555
5656print_status " Starting Maven release process..."
5757
58+ # Check if release tag already exists and offer to clean up
59+ RELEASE_TAG=" linkeddatahub-$RELEASE_VERSION "
60+ if git tag -l | grep -q " ^$RELEASE_TAG $" ; then
61+ print_warning " Release tag '$RELEASE_TAG ' already exists from a previous attempt."
62+ print_warning " This usually means a previous release failed partway through."
63+ read -p " Do you want to clean up and retry? (y/N): " -n 1 -r
64+ echo
65+ if [[ $REPLY =~ ^[Yy]$ ]]; then
66+ print_status " Cleaning up previous release attempt..."
67+ git tag -d " $RELEASE_TAG " 2> /dev/null || true
68+ mvn release:clean
69+ else
70+ print_error " Cannot proceed with existing release tag. Please clean up manually or use a different version."
71+ exit 1
72+ fi
73+ fi
74+
5875# Configure Maven release plugin to not push changes automatically
5976mvn release:clean release:prepare -DpushChanges=false -DlocalCheckout=true
6077
@@ -114,4 +131,4 @@ print_status "- Artifacts deployed to Sonatype"
114131# Show final status
115132print_status " Current branch status:"
116133echo " Master: $( git log --oneline -1 master) "
117- echo " Develop: $( git log --oneline -1 develop) "
134+ echo " Develop: $( git log --oneline -1 develop) "
You can’t perform that action at this time.
0 commit comments