-
Notifications
You must be signed in to change notification settings - Fork 1
/
publish.sh
executable file
·28 lines (24 loc) · 734 Bytes
/
publish.sh
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
#!/bin/bash
# Exit immediately if a command exits with a non-zero status.
set -e
# Import secrets
source secrets.sh
# Exit if not on tagged commit
if [[ "$(git describe)" == *-* ]]; then
echo "Error:" 1>&2
echo " Can't package a non-tagged commit." 1>&2
echo " Your current git commit isn't tagged with a proper version." 1>&2
echo " Try 'git tag -a' first" 1>&2
exit 1
fi
# Install dependencies
python -m pip install -e .[test]
python -m pip install -e .[data]
# Run tests
PYTHONPATH=. pytest --cov=hypixel --cov-report term
# Remove old builds if they exist
rm -rfv dist build hypixel.py.egg-info
# Build package
python -m build
# Publish package
twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD