From cb076ab796bf88bbf29951a2f7d751909b61b279 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sun, 18 May 2025 23:17:30 +0200 Subject: [PATCH] Tag releases based on .. Move away from the week based increment because I don't use week numbers for anything in my daily life, which makes them hard to evaluate time from, and replace the per week bump with a global increment. This means that it's easy to see at a glance from two version numbers how far appart they are in both time and number of releases. --- tag-release.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tag-release.sh b/tag-release.sh index 24575c1..c5527fa 100644 --- a/tag-release.sh +++ b/tag-release.sh @@ -1,11 +1,11 @@ #!/bin/bash -# Finds the next available r.. identifier for the current year and week -YEAR_WEEK=$(date -u +%g.%-V) -YEAR=${YEAR_WEEK:0:2} -WEEK=${YEAR_WEEK:3} -LAST_BUMP=$(git tag --list | grep '^r'$YEAR'\.'$WEEK'\.\(0\|[1-9][0-9]*\)$' | cut -d . -f 3 | sort -nr | head -n 1) -RELEASE=r${YEAR_WEEK}.$(( ${LAST_BUMP:--1} + 1 )) +# Finds the next available r.. identifier +YEAR_MONTH=$(date -u +%Y.%-m) +YEAR=${YEAR_MONTH:0:4} +MONTH=${YEAR_MONTH:5} +LAST_INCREMENT=$(git tag --list | grep '^r[1-9][0-9]*\.\([1-9]\|1[0-2]\)\.\(0\|[1-9][0-9]*\)$' | cut -d . -f 3 | sort -nr | head -n 1) +RELEASE=r${YEAR_MONTH}.$(( ${LAST_INCREMENT:--1} + 1 )) git tag $RELEASE echo Tagged $RELEASE