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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/usr/bin/env bash
#
# EFI Boot Guard
#
# Copyright (c) Siemens AG, 2014-2022
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
#
# SPDX-License-Identifier: GPL-2.0-only
#
usage() {
echo "usage: $0 name"
exit 1
}
name=$1
if [ -z "$name" ]; then
usage
fi
if [ ! -f VERSION ] || [ ! -d .git ]; then
echo "Must be run from top-level directory"
exit 1
fi
if [ -n "$(git status -s -uno)" ]; then
echo "Working directory is dirty!"
exit 1
fi
match=$(grep -e "-version-info" $(git rev-parse --show-toplevel)/Makefile.am)
echo -e "Library version: ${match/*-version-info /}"
echo -ne "Still accurate? (y/N) "
read answer
if [ "$answer" != "y" ]; then
exit 1
fi
echo -e "Tag commit\n\n $(git log -1 --oneline)"
echo -e "\nof branch\n\n $(git branch | sed -n 's/^\* //p')"
echo -ne "\nas $name? (y/N) "
read answer
if [ "$answer" != "y" ]; then
exit 1
fi
echo $name > VERSION
git commit -sv VERSION -m "Bump version number"
git tag -as $name -m "Release $name"
|