-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdo_release.sh
More file actions
executable file
·35 lines (27 loc) · 813 Bytes
/
do_release.sh
File metadata and controls
executable file
·35 lines (27 loc) · 813 Bytes
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
#!/bin/bash
if ! git diff-index --quiet HEAD --; then
echo You must commit all your changes before updating the version
exit 1
fi
old_version=$(cat VERSION)
if [ $# -ne 1 ]; then
read -p "Current version is $old_version. Enter a new version: " version
else
version=$1
fi
if [ "$old_version" = "$version" ]; then
echo Already at version $version
exit 1
fi
echo Updating version to $version
echo $version > VERSION
read -p "Do you wish to commit the new version, tag and push? [y/N] " tyn
if echo "$tyn" | grep -iq "^y"; then
git commit -am "bump to $version" && git tag v$version && git push && git push --tags
read -p "Do you wish to build and publish the release? [y/N] " pyn
if echo "$pyn" | grep -iq "^y"; then
rm *.gem
gem build vizbuilder.gemspec
gem push *.gem
fi
fi