|
@@ -0,0 +1,41 @@
|
|
1
|
+#!/bin/bash
|
|
2
|
+set -e -x
|
|
3
|
+
|
|
4
|
+export PYHOME=/home
|
|
5
|
+cd ${PYHOME}
|
|
6
|
+
|
|
7
|
+/opt/python/cp37-cp37m/bin/pip install twine cmake
|
|
8
|
+ln -s /opt/python/cp37-cp37m/bin/cmake /usr/bin/cmake
|
|
9
|
+
|
|
10
|
+# Compile wheels
|
|
11
|
+for PYBIN in /opt/python/cp3*/bin; do
|
|
12
|
+ "${PYBIN}/pip" wheel /io/ -w wheelhouse/
|
|
13
|
+ "${PYBIN}/python" /io/setup.py sdist -d /io/wheelhouse/
|
|
14
|
+done
|
|
15
|
+
|
|
16
|
+# Bundle external shared libraries into the wheels
|
|
17
|
+for whl in wheelhouse/*.whl; do
|
|
18
|
+ auditwheel repair "$whl" -w /io/wheelhouse/
|
|
19
|
+done
|
|
20
|
+
|
|
21
|
+# Test
|
|
22
|
+for PYBIN in /opt/python/cp3*/bin/; do
|
|
23
|
+ "${PYBIN}/pip" install -r /io/requirements-test.txt
|
|
24
|
+ "${PYBIN}/pip" install --no-index -f /io/wheelhouse nb-cpp
|
|
25
|
+ (cd "$PYHOME"; "${PYBIN}/pytest" /io/test/)
|
|
26
|
+done
|
|
27
|
+
|
|
28
|
+# Upload
|
|
29
|
+for WHEEL in /io/wheelhouse/nb_cpp*; do
|
|
30
|
+ # dev
|
|
31
|
+ # /opt/python/cp37-cp37m/bin/twine upload \
|
|
32
|
+ # --skip-existing \
|
|
33
|
+ # --repository-url https://test.pypi.org/legacy/ \
|
|
34
|
+ # -u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" \
|
|
35
|
+ # "${WHEEL}"
|
|
36
|
+ # prod
|
|
37
|
+ /opt/python/cp37-cp37m/bin/twine upload \
|
|
38
|
+ --skip-existing \
|
|
39
|
+ -u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" \
|
|
40
|
+ "${WHEEL}"
|
|
41
|
+done
|