generated from kasmtech/workspaces_registry_template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmkrelease
executable file
·43 lines (36 loc) · 919 Bytes
/
mkrelease
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
#!/bin/bash
#
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
SCRIPT_PATH="$(realpath $SCRIPT_PATH)"
cd "${SCRIPT_PATH}"
[ -f VERSION ] || {
echo "VERSION file missing. Exiting."
exit 1
}
. ./VERSION
usage() {
printf "\nUsage: mkrelease [-d] [-u]"
printf "\nWhere:"
printf "\n\t-d indicates create draft release"
printf "\n\t-u displays this usage message and exits\n"
exit 1
}
DRAFT=
while getopts "du" flag; do
case $flag in
d)
DRAFT="--draft"
;;
u)
usage
;;
esac
done
shift $(( OPTIND - 1 ))
ANNO="Kasm Registry Version ${VERSION}r${RELEASE}"
gittag v${VERSION}r${RELEASE} ${ANNO}
echo "Creating release for version ${VERSION} release ${RELEASE}"
gh release create v${VERSION}r${RELEASE} ${DRAFT} \
--title "${ANNO}" \
--notes-file ReleaseNotes.md
git fetch --tags origin