-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmkrelease
More file actions
executable file
·88 lines (78 loc) · 1.95 KB
/
mkrelease
File metadata and controls
executable file
·88 lines (78 loc) · 1.95 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
usage() {
printf "\nUsage: mkrelease [-c] [-d] [-p] [-u]"
printf "\nWhere:"
printf "\n\t-c indicates clean first"
printf "\n\t-d indicates create draft release"
printf "\n\t-p indicates skip package creation step"
printf "\n\t-u displays this usage message and exits\n"
exit 1
}
SCRIPT_PATH="$(
cd "$(dirname "$0")"
pwd -P
)"
have_real=$(type -p realpath)
[ "${have_real}" ] && SCRIPT_PATH="$(realpath $SCRIPT_PATH)"
cd "${SCRIPT_PATH}/.."
CLEAN=
DRAFT=
PACKAGE=1
BRANCH="main"
while getopts "b:cdpu" flag; do
case $flag in
b)
BRANCH="${OPTARG}"
;;
c)
CLEAN=1
;;
d)
DRAFT="--draft"
;;
p)
PACKAGE=
;;
u)
usage
;;
esac
done
shift $(( OPTIND - 1 ))
if [ -f BotControl/VERSION ]; then
source BotControl/VERSION
else
echo "ERROR: missing BotControl/VERSION"
exit 1
fi
ANNO="BotControl release, version ${VERSION}"
if [ -f ${HOME}/.mrprivate ]; then
source ${HOME}/.mrprivate
else
echo "ERROR: Could not locate ${HOME}/.mrprivate"
exit 1
fi
tar cf - BotControl/install \
BotControl/bin \
BotControl/crontab.in \
BotControl/example_dot_botctrl \
BotControl/examples \
BotControl/LICENSE \
BotControl/botctrl \
BotControl/man \
BotControl/markdown \
BotControl/usage.txt \
BotControl/viewman \
BotControl/VERSION | gzip -9 > BotControl/botctrl-${VERSION}.tar.gz
cd BotControl
gh release create v${VERSION} ${DRAFT} \
--title "${ANNO}" \
--target "${BRANCH}" \
--notes-file Release_Notes.md \
botctrl \
example_dot_botctrl \
install \
uninstall \
botctrl-${VERSION}.tar.gz
git fetch --tags origin
rm -f botctrl-${VERSION}.tar.gz