-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease.sh
executable file
·35 lines (27 loc) · 967 Bytes
/
release.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
29
30
31
32
33
34
35
#!/usr/bin/env bash
# TODO: Wrap in virtualenv, maybe a Docker container for building
rm -rf build dist polycraft_lab.egg-info
# Ensure dependencies are installed before release
echo -e "\n=======Preparing dependencies for release======="
pip3 install -r requirements.txt
# Install build tools
pip3 install build twine
# Create distribution archives for PAL
echo -e "\n==========Creating archives for release========="
# TODO: Handle virtual environment issue
python3 -m build --sdist --wheel --no-isolation
python setup.py sdist bdist_wheel
# Upload to PyPI
echo -e "\n================Uploading to PyPI==============="
# Verify the long_description in setup.py makes sense
twine check dist/*
if [ "$1" = "--release" ]; then
echo "Uploading to PyPI"
twine upload dist/*
else
echo "Uploading to test PyPI repository"
twine upload dist/* --repository testpypi
fi
echo "Release complete!"
# Clean up files
rm -rf build dist polycraft_lab.egg-info