forked from Baekalfen/PyBoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.deploy.sh
48 lines (38 loc) · 1.43 KB
/
.deploy.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
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -e
if [[ "$OS" == "Windows_NT" && "$MSYS" == "" ]]; then
echo "Native Windows"
PY='/c/Program Files/Python37/python.exe'
else
echo "Unix-like"
PY=python3
fi
"$PY" -m pip install wheel twine
"$PY" setup.py sdist bdist_wheel
if [ "$MANYLINUX" ]; then
"$PY" -m pip install auditwheel
auditwheel repair dist/*.whl
# Patching in the correct SDL2
cd wheelhouse
yum -y install zip
for f in *.whl; do
echo "Patching $f file..."
SDLNAME=$(unzip -l $f | egrep -wo "(pyboy.libs/libSDL2.*$)")
mkdir -p pyboy.libs
cp /usr/local/lib/libSDL2-2.0.so.0 $SDLNAME
# Updating single SDL2 file in the .zip (.whl)
zip $f $SDLNAME
done
cd ..
rm -rf dist/*.whl
mv wheelhouse/*.whl dist/
fi
"$PY" -m twine upload --non-interactive -u '__token__' -p $PYPI_TOKEN dist/*.whl
# "$PY" -m twine upload --non-interactive --repository-url https://test.pypi.org/legacy/ -u '__token__' -p $PYPI_TOKEN_TEST dist/*.whl --verbose
if [ "$PYPI_SOURCE" ]; then
# Pure source. We can only upload it once. It's randomly done from the manylinux platform
"$PY" -m twine upload --non-interactive -u '__token__' -p $PYPI_TOKEN dist/*.tar.gz
# "$PY" -m twine upload --non-interactive --repository-url https://test.pypi.org/legacy/ -u '__token__' -p $PYPI_TOKEN_TEST dist/*.tar.gz
# Initiate the Docker Hub build process
curl -X POST $DOCKER_HUB_BUILD_POST
fi