builder/tag-release.sh
Hornwitser c3e3ff0959 Implement builder image
Add docker build to create a shared image for running CI pipelines and
docker builds based on debian.
2024-07-13 13:53:08 +02:00

11 lines
379 B
Bash

#!/bin/bash
# Finds the next available r<year>.<week>.<bump> 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 ))
git tag $RELEASE
echo Tagged $RELEASE