@echo off
cls

rem Name of git tag.
set TAG_NAME="v%DATE:-=.%"

rem Remove old local tag.
call git tag -d "%TAG_NAME%"

rem Remove old remote tag.
call git push origin --delete "%TAG_NAME%"

rem Prepare a release without push remote tag and changes.
call mvn release:prepare -DremoteTagging=false -DpushChanges=false

rem Push remote tag and changes.
call git commit -a -m "Prepare a release"
call git tag "%TAG_NAME%"
call git push
call git push --tags
call git push origin

rem Perform a release.
call mvn release:perform

rem end of file