Skip to content

Commit

Permalink
Add script to push release
Browse files Browse the repository at this point in the history
  • Loading branch information
klieret committed Apr 18, 2019
1 parent 49a4637 commit a888636
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

set -e

# Upload to pypi
# Note: Need to bump version first!
# (it's impossible to amend a release, you can only
# make a new release)

thisDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
sourceDir="${thisDir}/.."

oldDir=$(pwd)

function atExit {
cd "${oldDir}"
}

trap atExit EXIT

cd "${sourceDir}"

rm -rf "dist/"

version=$(cat ankipandas/version.txt)
echo "Version is: " $version

python3 setup.py sdist bdist_wheel
python3 -m twine upload --verbose --repository-url https://upload.pypi.org/legacy/ dist/*
git tag -a "v${version}" -m "Release version ${version}"
git push origin "v${version}"

0 comments on commit a888636

Please sign in to comment.