-
Notifications
You must be signed in to change notification settings - Fork 10
88 lines (81 loc) · 3.14 KB
/
pythonPublishTest.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Upload Python Package on test server
on:
workflow_dispatch:
push:
paths:
- 'src_interfaces/python3_interface.cpp'
- 'include_interfaces/inerfaceTemplate.hpp'
- 'include_interfaces/python3_interface.hpp'
- '.github/workflows/pythonPublishTest.yml'
# pull_request:
# paths:
# - 'src_interfaces/python3_interface.cpp'
# - 'include_interfaces/inerfaceTemplate.hpp'
# - 'include_interfaces/python3_interface.hpp'
# - '.github/workflows/pythonPublishTest.yml'
jobs:
deploy:
name: Compile for ubuntu-22.04 using ${{ matrix.python }}-${{ matrix.arch }} and upload on packages manager
strategy:
fail-fast: false
matrix:
python: [ '3.10','3.11', 'pypy-3.8', 'pypy-3.9' ]
arch:
- x64
runs-on: ubuntu-22.04
env:
NAME: value
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.arch }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
pip install oldest-supported-numpy
pip install setuptools wheel twine packaging
- name: Install Ubuntu dependencies
run: |
sudo add-apt-repository 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe'
sudo apt update;
sudo apt install build-essential libzmq3-dev patchelf libtool
sudo apt -y install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11
wget "https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp" -O include/zmq.hpp
wget 'https://codeload.github.com/open-source-parsers/jsoncpp/zip/master' -O jsoncpp.zip
unzip jsoncpp.zip
cd jsoncpp-master
python amalgamate.py
cd ..
git clone https://github.com/zeromq/libzmq.git
cd libzmq
export CFLAGS="-fPIC"
export CXXFLAGS="-fPIC"
bash ./autogen.sh
./configure --prefix=/tmp/zeromq
make -j
make install
echo "STATIC_ZMQ_PATH=/tmp/zeromq/lib/libzmq.a" >> $GITHUB_ENV
- name: Build on Linux
run: |
cd build/python-build
STATIC_ZMQ_PATH=${{ env.STATIC_ZMQ_PATH }} python setup.py --setuptools bdist_wheel
- name: Correct whl for Linux
run: |
cd build/python-build/dist
# pip install auditwheel
# auditwheel repair *.whl
# for wheel in $(find . -iname "*.whl") ; do unzip -o $wheel; patchelf --clear-symbol-version stat --clear-symbol-version _ZSt28__throw_bad_array_new_lengthv g2s/*.so; zip -u $wheel g2s/*.so; done
for wheel in $(find . -iname "*.whl") ; do mv $wheel $(echo $wheel | sed 's/-linux_/-manylinux1_/'); done
- name: Publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
run: |
cd build/python-build
twine upload dist/*.whl --repository-url https://test.pypi.org/legacy/ --verbose --skip-existing