Skip to content

Commit 87d72c0

Browse files
committed
Misc release script improvements
Signed-off-by: Joffrey F <[email protected]>
1 parent 205a2f7 commit 87d72c0

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

scripts/release.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,26 @@ echo "##> Removing stale build files"
2222
rm -rf ./build || exit 1
2323

2424
echo "##> Tagging the release as $VERSION"
25-
git tag $VERSION || exit 1
25+
git tag $VERSION
26+
if [[ $? != 0 ]]; then
27+
head_commit=$(git show --pretty=format:%H HEAD)
28+
tag_commit=$(git show --pretty=format:%H $VERSION)
29+
if [[ $head_commit != $tag_commit ]]; then
30+
echo "ERROR: tag already exists, but isn't the current HEAD"
31+
exit 1
32+
fi
33+
fi
2634
if [[ $2 == 'upload' ]]; then
2735
echo "##> Pushing tag to github"
2836
git push $GITHUB_REPO $VERSION || exit 1
2937
fi
3038

3139

3240
pandoc -f markdown -t rst README.md -o README.rst || exit 1
41+
echo "##> sdist & wheel"
42+
python setup.py sdist bdist_wheel
43+
3344
if [[ $2 == 'upload' ]]; then
34-
echo "##> Uploading sdist to pypi"
35-
python setup.py sdist bdist_wheel upload
36-
else
37-
echo "##> sdist & wheel"
38-
python setup.py sdist bdist_wheel
39-
fi
45+
echo '##> Uploading sdist to pypi'
46+
twine upload dist/docker-$VERSION*
47+
fi

0 commit comments

Comments
 (0)