Permalink
Browse files

Upgraded releas script

  • Loading branch information...
1 parent bc0ea36 commit 650aef21f9847ff08213833911e783101fc820b5 @noirbizarre committed Nov 3, 2012
Showing with 13 additions and 2 deletions.
  1. +13 −2 release.sh
View
@@ -5,24 +5,35 @@
# Build a source distrbution and upload on PyPI
# Update version for new develpoment cycle
VERSION_FILE=ember/__init__.py
+CHANGELOG_FILE=CHANGELOG.rst
+README_FILE=README.rst
+
+CHANGELOG_CURRENT='Current\n-------'
+READ_THE_DOC='http:\/\/django-ember.readthedocs.org\/en'
CURRENT=$(grep __version__ $VERSION_FILE | sed "s/__version__ = '\(.*\)'/\1/")
echo -n "Current version is $CURRENT, what version do you want to release ? "
read RELEASE
+CHANGELOG_VERSION="$RELEASE ($(date +%Y-%m-%d))"
+SEP=$( printf "%${#CHANGELOG_VERSION}s" | tr " " "-" )
python setup.py clean
rm -rf *egg-info build dist
sed -i "s/$CURRENT/$RELEASE/" $VERSION_FILE
-git commit $VERSION_FILE -m "Bump version $RELEASE"
+sed -i "1!N; s/$CHANGELOG_CURRENT/$CHANGELOG_VERSION\n$SEP/" $CHANGELOG_FILE
+sed -i "s/$READ_THE_DOC\/latest/$READ_THE_DOC\/$RELEASE/" $README_FILE
+git commit $VERSION_FILE $CHANGELOG_FILE $README_FILE -m "Bump version $RELEASE"
git tag $RELEASE
python setup.py register sdist upload
echo -n "Version $RELEASE released, what version do you want for next development cycle ? "
read NEXT
sed -i "s/$RELEASE/$NEXT/" $VERSION_FILE
-git commit $VERSION_FILE -m "Updated to version $NEXT for next development cycle"
+sed -i "s/$READ_THE_DOC\/$RELEASE/$READ_THE_DOC\/latest/" $README_FILE
+sed -i "1!N; s/$CHANGELOG_VERSION/$CHANGELOG_CURRENT\n\n- nothing yet\n\n\n$CHANGELOG_VERSION/" $CHANGELOG_FILE
+git commit $VERSION_FILE $CHANGELOG_FILE $README_FILE -m "Updated to version $NEXT for next development cycle"
echo "--------------------------------------------------------------"
echo "Released version $RELEASE and prepare $NEXT development cycle."

0 comments on commit 650aef2

Please sign in to comment.