Skip to content

Commit

Permalink
Add on_master check to tagging recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescooke committed Apr 27, 2018
1 parent 59570b2 commit c5d58e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ testpypi: clean sdist bdist_wheel
pypi: clean sdist bdist_wheel
twine upload dist/*

.PHONY: on_master
on_master:
./on_master.sh

.PHONY: tag
tag:
tag: on_master
git tag -a $$(python -c 'from flake8_aaa.__about__ import __version__; print("v{}".format(__version__))')
12 changes: 12 additions & 0 deletions on_master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -eo pipefail

git fetch origin -v

branch_info=$(git status --short -b | head -1)

if [[ $branch_info != '## master...origin/master' ]]; then
echo "Not on master or master not up to date with origin, branch = $branch_info"
exit 1
fi

0 comments on commit c5d58e5

Please sign in to comment.