aboutsummaryrefslogtreecommitdiff
path: root/maint/tag-arti-release
blob: 72812788cf5377f3215b79fa3ca43f1984d92c7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /usr/bin/env bash
#
# usage:
#   maint/tag-arti-release [--dry-run] VERSION [<git tag options ...>]
set -e

simulate=''

badusage () { echo >&2 "bad usage"; exit 12; }

while [ $# != 0 ]; do
    case "$1" in
	--dry-run) simulate=:; shift ;;
	--) shift; break ;;
	-*) badusage ;;
	*) break ;;
    esac
done

version="$1"; shift || badusage

diff -u <(echo "$version") <(perl <CHANGELOG.md -wne '
	next unless m{^\# };
	die "$_ ?" unless s{^\# Arti\s+}{};
	die "$_ ?" unless s{\s+.*}{};
	print;
	exit;
')

message="Arti v$version

$(maint/list-crates --version)
"

set -x
$simulate git tag "$@" -s "arti-v$version" -m "$message"