Misc release script improvements

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2018-08-09 17:28:35 -07:00
parent 205a2f76bd
commit 87d72c0f6c
1 changed files with 15 additions and 7 deletions

View File

@ -22,7 +22,15 @@ echo "##> Removing stale build files"
rm -rf ./build || exit 1
echo "##> Tagging the release as $VERSION"
git tag $VERSION || exit 1
git tag $VERSION
if [[ $? != 0 ]]; then
head_commit=$(git show --pretty=format:%H HEAD)
tag_commit=$(git show --pretty=format:%H $VERSION)
if [[ $head_commit != $tag_commit ]]; then
echo "ERROR: tag already exists, but isn't the current HEAD"
exit 1
fi
fi
if [[ $2 == 'upload' ]]; then
echo "##> Pushing tag to github"
git push $GITHUB_REPO $VERSION || exit 1
@ -30,10 +38,10 @@ fi
pandoc -f markdown -t rst README.md -o README.rst || exit 1
if [[ $2 == 'upload' ]]; then
echo "##> Uploading sdist to pypi"
python setup.py sdist bdist_wheel upload
else
echo "##> sdist & wheel"
python setup.py sdist bdist_wheel
if [[ $2 == 'upload' ]]; then
echo '##> Uploading sdist to pypi'
twine upload dist/docker-$VERSION*
fi