forked from golang/mobile
-
Notifications
You must be signed in to change notification settings - Fork 1
/
publish.sh
executable file
·50 lines (37 loc) · 1.09 KB
/
publish.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
#!/bin/bash
cd `dirname $0`
if [ -f .version ]; then
VERSION=$(cat .version)
else
VERSION=0
fi
VERSION=$(($VERSION + 1))
VERSION_NAME=`printf "v0.0.3-beta%02d" $VERSION`
echo Creating release: '<'$VERSION_NAME'>'
#while true; do
# read -p "Do you wish to proceed?: " yn
# case $yn in
# [Yy]* ) break;;
# [Nn]* ) exit;;
# * ) echo "Please answer yes or no.";;
# esac
#done
if git tag | grep "$VERSION_NAME" > /dev/null; then
while true; do
read -p "Existing Tag $VERSION_NAME found. Shall I delete it?: " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
echo removing existing tag "$VERSION_NAME"
git tag -d "$VERSION_NAME"
git push origin --delete "$VERSION_NAME"
fi
printf $VERSION > .version
git add .
git commit -am "$VERSION_NAME"
git tag "$VERSION_NAME" && git push && git push origin "$VERSION_NAME"
echo running GOPROXY=proxy.golang.org go list -m github.com/danbrough/mobile@$VERSION_NAME
GOPROXY=proxy.golang.org go list -m github.com/danbrough/mobile@$VERSION_NAME