-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
release
executable file
·44 lines (34 loc) · 1006 Bytes
/
release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
set -o pipefail
cd "$(dirname "$0")"/..
ROOT=$(pwd)
if [ -z "$VENV_NAME" ]; then
VENV_NAME="env"
fi
PYPYRC="$HOME/.pypirc"
if [ ! -e "$PYPYRC" ]; then
cat << EndOfMessage >&2
$PYPYRC does not exist, please create it with the following contents
[pypi]
username = __token__
password = [secret-token-goes-here]
EndOfMessage
exit 1
fi
ACTIVATE="$VENV_NAME/bin/activate"
if [ ! -f "$ACTIVATE" ]; then
echo "$ACTIVATE does not exist, run ./script/bootstrap" >&2
exit 1
fi
. "$ACTIVATE"
# Set so that setup.py will create a public release style version number
export OCTODNS_RELEASE=1
VERSION="$(grep "^__version__" "$ROOT/octodns_gcore/__init__.py" | sed -e "s/.* = '//" -e "s/'$//")"
git tag -s "v$VERSION" -m "Release $VERSION"
git push origin "v$VERSION"
echo "Tagged and pushed v$VERSION"
python -m build --sdist --wheel
twine check dist/*$VERSION.tar.gz dist/*$VERSION*.whl
twine upload dist/*$VERSION.tar.gz dist/*$VERSION*.whl
echo "Uploaded $VERSION"