CV=( ${CURRENT_VERSION//./ } )
CURRENT_MAJOR=${CV[0]}
CURRENT_MINOR=${CV[1]}
CURRENT_REV=${CV[2]}
NEXT_MAJOR=$CURRENT_MAJOR
NEXT_MINOR=$CURRENT_MINOR
NEXT_REV=`expr $CURRENT_REV + 1`
if [ $NEXT_REV -gt 9 ]; then
NEXT_MINOR=`expr $NEXT_MINOR + 1`
NEXT_REV=0
if [ $NEXT_MINOR -gt 9 ]; then
NEXT_MINOR=0
NEXT_MAJOR=`expr $NEXT_MAJOR + 1`
fi
fi
NEXT_VERSION="$NEXT_MAJOR.$NEXT_MINOR.$NEXT_REV"
BRANCH="release_${NEXT_MAJOR}_${NEXT_MINOR}"
echo "You are about to build and publish version $NEXT_VERSION"
read -sn 1 -p "Press any key to continue..."
echo
if [ ! -d "./venv" ]; then
virtualenv venv
fi
Make sure we are in sync with remote
git checkout -q master && git fetch -q && git pull -q
Verify that there is nothing to commit
if [ $(git_is_dirty) -eq 1 ]; then
git status
echo
echo -e " [error] Hey dumbass, commit your shit.. Abort !\n\n"
exit 1
fi
Verify that there is no untracked files
if [ $(git_has_untracked_files) -gt 0 ]; then
git status
echo
echo -e " [error] I see untracked files, you dirty bastard.. Abort !\n\n"
exit 1
fi
echo " [info] Bumping version"
sed -i -e "s/ version='"$CURRENT_VERSION"',/ version='"$NEXT_VERSION"',/" setup.py
git commit -aqm "Version bump: $CURRENT_VERSION -> $NEXT_VERSION wip"
git push -q
echo " [info] Creating tag v$NEXT_VERSION"
git tag "v$NEXT_VERSION" -m "Release $NEXT_VERSION"
git push --tags origin "v$NEXT_VERSION"
echo " [info] Updating changelog"
./venv/bin/pip install -q gitchangelog
./venv/bin/gitchangelog > CHANGELOG
git add CHANGELOG
git commit -qm "Updated CHANGELOG wip"
git push -q
check if a git branch exists for the current major_minor release (ex: release_1_0)
if [ `git branch --list $BRANCH` ]; then if not, create one.
echo " [info] UPDATING release branch $BRANCH"
git checkout -q $BRANCH
git merge -q origin/master
else
echo " [info] CREATING release branch $BRANCH"
git checkout -q -b $BRANCH
fi
git push -q --set-upstream origin $BRANCH > /dev/null
git checkout -q master
echo " [info] Pushing to PyPi"
./venv/bin/pip install -q wheel twine
./venv/bin/python setup.py sdist
./venv/bin/python setup.py bdist_wheel --universal
./venv/bin/twine upload dist/kolors-$NEXT_VERSION*
if [ $? -eq 0 ]; then
echo OK
echo " [done] Published release v$NEXT_VERSION"
echo
rm -rf venv
exit 0
else
echo " [FAIL] Failed to publish v$NEXT_VERSION"
echo
rm -rf venv
exit 1
fi
Changelog
=========
(unreleased)
------------
- Update README.rst. [Maxime Haineault]
- Merge pull request 1 from networkjanitor/patch-1. [Maxime Haineault]
updated project url in setup.py
- Updated project url in setup.py. [Xyoz Netsphere]
- Merge pull request 2 from Duroktar/hotfix/fix-readme-formatting-on-
pypi. [Maxime Haineault]
Fixed readme formatting on PyPi.
- Merge branch 'master' into hotfix/fix-readme-formatting-on-pypi.
[Maxime Haineault]
- Merge pull request 3 from remram44/fix. [Maxime Haineault]
Fix package structure
- Merge branch 'master' into fix. [Maxime Haineault]
- Updated README.rst. [Maxime Haineault]
- Updated README. [Maxime Haineault]
- Translated README.md to README.rst (thanks u/flying-sheep) [Maxime
Haineault]
- Updated release script (yeah again) [Maxime Haineault]
- Updated release script. [Maxime Haineault]
- Updated release script. [Maxime Haineault]
- Fixed project URL. [Maxime Haineault]
- Convert README to RST. [Remi Rampin]
- Fix incorrect package_data. [Remi Rampin]
package_data is not intended for that, and because the paths are
relative to the package this doesn't work (files don't get included).
- Fix setup.py. [Remi Rampin]
- Fix readme formatting on PyPi. [traBpUkciP]
This provides a cross-compatible README file
for both GitHub and PyPi.
Changes -
- `README.md` -> `README.rst`
- Update long_description source in `setup.py`
- Added name and description to `CHANGELOG`