-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathupdate-release.sh
More file actions
executable file
·28 lines (28 loc) · 972 Bytes
/
update-release.sh
File metadata and controls
executable file
·28 lines (28 loc) · 972 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
#!/bin/sh
# This is used by me to update the repository to a new version quickly.
# This must be executed with a new tag as the command line argument.
# If any command fails for any reason, the script will exit immediately.
# No version checks are done on the tags, and automatic commit messages are created for a version update.
# I got tired of manually updating the readme file, among other things I was doing, so combine them here.
. ./functions.sh
oldtag=$(git_version)
newtag=$1
if [ -z "$newtag" ]; then
echo The update tag cannot be blank.
exit
fi
if [ "$oldtag" = "$newtag" ]; then
echo The old tag and new tag are identical. Not upgrading.
exit
fi
echo "Upgrading from $oldtag to $newtag."
echo Generating certificate.
gen_cert
echo Committing update.
check git commit -a -s -m \"release: ${newtag}\"
echo Pushing update.
check git push
echo Tagging update.
check git tag -s -m \"release: ${newtag}\" -a ${newtag}
echo Releasing.
check git push origin ${newtag}