builder/tag-release.sh
Hornwitser cb076ab796
All checks were successful
/ build (push) Successful in 2m33s
Tag releases based on <year>.<month>.<increment>
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.
2025-05-18 23:17:30 +02:00

11 lines
384 B
Bash

#!/bin/bash
# Finds the next available r<year>.<month>.<increment> 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