This repository was archived by the owner on May 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·54 lines (39 loc) · 1.34 KB
/
release.sh
File metadata and controls
executable file
·54 lines (39 loc) · 1.34 KB
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
#!/bin/bash
set -e
# make sure origin/master is what we expect
ORIGIN=$(git config --get remote.origin.url)
EXPECTED_ORIGIN="git@github.com:authy/authy-python.git"
if [ "$ORIGIN" != "$EXPECTED_ORIGIN" ]
then
echo "Unexpected remote $ORIGIN. Please make sure your remote origin is $EXPECTED_ORIGIN"
exit
else
echo "Remote origin verified. Proceeding to get the latest from master."
fi
# make sure you have the bumpversion dependency
command -v bumpversion >/dev/null 2>&1 || { echo "Activate your virtualenv for 'bumpversion' dependency" >&2; exit 1; }
# this will fail if there are local changes. that's ok.
git checkout master
git fetch && git rebase
########################
# UPDATE RELEASE NOTES #
########################
echo "Updating release notes"
bash notes.sh
################
# BUMP VERSION #
################
# https://github.com/peritus/bumpversion
# This command does several things!
# * updates patch versions in .bumpversion.cfg and authy/__init__.py
# * Adds+commits to Git .bumpversion.cfg and authy/__init__.py files
# * Adds Git tag with new version
echo 'Bumping patch version'
bumpversion patch
##################
# DEPLOY CHANGES #
##################
echo 'Commiting changes and pushing to master'
# commit changes to master
# this will kick off the Travis CI build which auto-deploys to PyPI
git push origin master --tags