-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Cutting a release | ||
|
||
|
||
|
||
1. Run `scripts/release.sh`. This cuts a new release on PyPI. You | ||
will have to have a PyPI account and have access to the epitome | ||
project for this to work. | ||
|
||
2. The release script will push a release branch to your repository. | ||
Make a pull request to upstream from this branch. | ||
|
||
3. Tag a release on github. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/sh | ||
|
||
set -e -x | ||
|
||
# do we have enough arguments? | ||
if [ $# -lt 2 ]; then | ||
echo "Usage:" | ||
echo | ||
echo "./release.sh <release version> <development version>" | ||
exit 1 | ||
fi | ||
|
||
# get current version | ||
current_version=$(python version.py) | ||
|
||
# get current branch | ||
branch=$(git status -bs | awk '{ print $2 }' | awk -F'.' '{ print $1 }' | head -n 1) | ||
|
||
# fclean up if something goes wrong | ||
function clean_up { | ||
|
||
find . -name "*.bak" -exec rm -f {} \; | ||
git checkout version.py | ||
git checkout ${branch} | ||
git branch -D ${release} | ||
} | ||
trap clean_up EXIT | ||
|
||
# pick arguments | ||
release=$1 | ||
devel=$2 | ||
|
||
# checkout release | ||
git checkout -b ${release} ${branch} | ||
|
||
# update current version | ||
find . -name "version.py" -exec sed -e "s/${current_version}/${release}/g" \ | ||
-i.${current_version}.bak '{}' \; | ||
|
||
find . -name "*${current_version}.bak" -exec rm -f {} \; | ||
|
||
# commit version changes | ||
git add version.py | ||
# allow empty in case version was already release version (mainly for pre-releases) | ||
git commit --allow-empty -m "bumped version from ${current_version} to release version ${release}" | ||
|
||
# build sdist and push to pypi | ||
pip install twine | ||
make pypi | ||
if [ $? != 0 ]; then | ||
echo "Releasing epitome to PyPi failed." | ||
exit 1 | ||
fi | ||
|
||
# push branch to upstream | ||
git push upstream ${release} | ||
|
||
# update version to devel | ||
current_version=$(python version.py) | ||
find . -name "version.py" -exec sed -e "s/${release}/${devel}/g" \ | ||
-i.${release}.bak '{}' \; | ||
|
||
find . -name "*${release}.bak" -exec rm -f {} \; | ||
|
||
# commit version changes | ||
git add version.py | ||
git commit -m "bumped version from ${release} to ${devel}" | ||
|
||
# pull request devel to master | ||
git push origin ${release} | ||
|
||
git checkout master | ||
echo "Done. Now make a pull request from ${release} and tag a release on github for ${release}" |