-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
mkrelease
executable file
·53 lines (45 loc) · 1.11 KB
/
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
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
[ -f VERSION ] || {
echo "VERSION file missing. Exiting."
exit 1
}
. ./VERSION
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
}
CLEAN=
DRAFT=
PACKAGE=1
while getopts "cdpu" flag; do
case $flag in
c)
CLEAN=1
;;
d)
DRAFT="--draft"
;;
p)
PACKAGE=
;;
u)
usage
;;
esac
done
shift $(( OPTIND - 1 ))
[ "$CLEAN" ] && ./clean
[ "$PACKAGE" ] && ./mkpkg
ANNO="RoonCommandLine Version ${VERSION} Release ${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 pkg/release.md \
releases/${VERSION}/*
git fetch --tags origin