forked from gexclaude/aaregurucli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·50 lines (40 loc) · 1.07 KB
/
release.sh
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
#!/bin/bash
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-v|--version)
RELEASEVERSION="$2"
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [ -z "${RELEASEVERSION}" ] ; then
echo "releaseversion must be set"
exit -1
fi
echo RELEASE VERSION = "${RELEASEVERSION}"
while true; do
read -p "Do you wish to release with this version? y/n: " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
git tag -a "${RELEASEVERSION}" -m "${RELEASEVERSION} release tag"
if [ $? -ne 0 ]; then { echo "Failed, aborting." ; exit 1; }; fi
git push origin "${RELEASEVERSION}"
if [ $? -ne 0 ]; then { echo "Failed, aborting." ; exit 1; }; fi
rm -rf dist
if [ $? -ne 0 ]; then { echo "Failed, aborting." ; exit 1; }; fi
goreleaser
if [ $? -ne 0 ]; then { echo "Failed, aborting." ; exit 1; }; fi
echo "done"