Introduce command/script generating the next tag for a project following YYYY.CW.patch schema
Opened this issue · 2 comments
nostadt commented
AC:
- Shows the last two tags for informative reason
- Validates the working directory and exits if it's not a git-repository.
- Outputs the new tag
CW means calendar week. Example: 2021.48.0
Additional note: This tag schema should not be used for composer packages which will be required by other. Use it for website projects for example where you only need/want a basic but informative tag history.
nostadt commented
Rejected for now. It's a nice to have tool, but I have a lot of other things on my plate.
nostadt commented
In a different project I came to the step, at which I am in need of a shell script. So, I am re-opening this issue.
- Include fetching tags from remote
- Show info/reminder: Before creating a release, make sure the branches are up to date
- Show last 2 tags
Following can be used to get started:
Get the amount of releases in this calender week:
git tag | grep -c $(date +"%Y.%-U")
Show tags:
git tag | grep $(date +"%Y.%-U")
Show new tag:
releaseNumber=$(git tag | grep -c $(date +"%Y.%-U"))
releaseVersion=$(date +"%Y.%-U.$releaseNumber")
echo "Going to make the tag: $releaseVersion"
Braindump:
echo ""
echo "This week releases:"
git tag | grep $(date +"%Y.%-U")
count=$(git tag | grep -c $(date +"%Y.%-U"))
echo "> count: $count"
echo ""
releaseVersion=$(date +"%Y.%-U.$count")
echo "New tag would be: $releaseVersion"