#!/bin/bash set -o errexit set -o nounset if [[ $# -ne 1 ]]; then echo "usage: ${0##*/} (edge|stable)-xx.xx.xx" >&2 exit 1 fi tag="$1" # Verify the tag format tag_format="^(edge|stable)-([0-9]+)\.([0-9]+)\.([0-9]+)$" if [[ $tag =~ $tag_format ]]; then # todo: Use these values to verify the tag version increment. # release_channel="${BASH_REMATCH[1]}" # release_major="${BASH_REMATCH[2]}" # release_minor="${BASH_REMATCH[3]}" # release_patch="${BASH_REMATCH[4]}" : else echo "tag format incorrect; expected: $tag_format" echo "example: edge-20.12.2, stable-2.10.1" exit 1 fi # todo: Verify the tag version increment. bindir=$( cd "${BASH_SOURCE[0]%/*}" && pwd ) # shellcheck source=bin/_release.sh tmp=$(. "$bindir"/_release.sh; extract_release_notes) # Create an unsigned tag with the commit message. git tag -s -F "$tmp" "$tag" # Success message echo "tag created and signed." echo "" echo "tag: $tag" echo "" echo "To push tag, run:" echo " git push origin $tag"