-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
mkrelease
executable file
·66 lines (56 loc) · 1.47 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
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/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 ))
[ "$PACKAGE" ] && {
have_arch=$(type -p makepkg)
[ "${have_arch}" ] || {
echo "Cannot locate makepkg"
echo "Install Arch packaging utilites with tools/install-pacman-debian.sh"
echo "Exiting without creating release or tags"
exit 1
}
}
[ "$CLEAN" ] && ./clean
ANNO="Asciiville Version ${VERSION} Release ${RELEASE}"
gittag v${VERSION}r${RELEASE} ${ANNO}
git fetch --tags origin
[ "$PACKAGE" ] && ./mkpkg
cp pkg/Install-bin.sh releases/${VERSION}/Install-bin.sh
cp pkg/Uninstall-bin.sh releases/${VERSION}/Uninstall-bin.sh
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}/*