Skip to content

Commit f88bd09

Browse files
authored
Build Manylinux wheels (#562)
* build manylinux wheel on multiple python versions * add checkout step * fix matrix * fix python-dev * allow multiple py version in tests * attempt to fix python * upload to test pypi * python-dev install fix * typo fix * workdir fix * update arg parsing * fix * install requirements * install requirements * fix * fix * fix * fix * fix * Fix tag * run tests after build * run tests after build * fix * fix * fix json * fix json * fix artifacts * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix pip installation * fix pip installation * incr timeout * fix pip * fix pip * fm python setup * leave python setup only for fedora * upload to twine * complete manylinux pip * rm unused steps * rm unused steps * fix * rename workflow, run only on release, get ready to merge
1 parent 4fbc16d commit f88bd09

File tree

7 files changed

+326
-134
lines changed

7 files changed

+326
-134
lines changed

.github/workflows/build-test-ubuntu20.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -86,35 +86,3 @@ jobs:
8686
name: Distributives
8787
path: meshlib-ubuntu20-dev.deb
8888
retention-days: 1
89-
90-
- name: Create and fix Wheel
91-
if: ${{ inputs.UPLOAD_ARTIFACTS && matrix.compiler == 'GCC 10' && matrix.config == 'Release'}}
92-
run: |
93-
curl http://nixos.org/releases/patchelf/patchelf-0.10/patchelf-0.10.tar.bz2 -L -o patchelf-0.10.tar.bz2
94-
tar xf patchelf-0.10.tar.bz2
95-
cd patchelf-0.10
96-
./configure
97-
make install
98-
cd ..
99-
python3 -m pip install --upgrade pip
100-
python3 -m pip install auditwheel wheel setuptools
101-
python3 ./scripts/wheel/setup_workspace.py
102-
cd ./scripts/wheel/meshlib
103-
python3 setup.py bdist_wheel --python-tag=cp38 --version ${{inputs.version}}
104-
python3 -m auditwheel repair --plat manylinux_2_31_x86_64 ./dist/*.whl
105-
106-
- name: Upload Wheel to Artifacts
107-
if: ${{ inputs.UPLOAD_ARTIFACTS && matrix.compiler == 'GCC 10' && matrix.config == 'Release'}}
108-
uses: actions/upload-artifact@v2
109-
with:
110-
name: Wheelhouse
111-
path: ./scripts/wheel/meshlib/wheelhouse/meshlib-*.whl
112-
retention-days: 1
113-
114-
- name: Upload Wheel to Distributive
115-
if: ${{ inputs.UPLOAD_ARTIFACTS && matrix.compiler == 'GCC 10' && matrix.config == 'Release'}}
116-
uses: actions/upload-artifact@v2
117-
with:
118-
name: Distributives
119-
path: ./scripts/wheel/meshlib/wheelhouse/meshlib-*.whl
120-
retention-days: 1

.github/workflows/nightly-tests.yml

Lines changed: 0 additions & 95 deletions
This file was deleted.

.github/workflows/pip-build.yml

Lines changed: 141 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,154 @@
11
name: Build Manylinux Pip
22

33
on:
4+
release:
5+
types: [ published ]
46
workflow_dispatch:
57

68
jobs:
7-
get-latest-tag:
9+
setup:
810
timeout-minutes: 5
911
runs-on: ubuntu-latest
1012
outputs:
1113
version_tag: ${{ steps.get-latest-tag.outputs.tag }}
1214
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
1318
- uses: actions-ecosystem/action-get-latest-tag@v1
1419
id: get-latest-tag
20+
21+
22+
manylinux-pip:
23+
needs: setup
24+
timeout-minutes: 25
25+
runs-on: ubuntu-latest
26+
container:
27+
image: meshrus/meshlib-ubuntu:latest
28+
options: --user root
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
py-version: ["3.8", "3.9", "3.10" ]
33+
include:
34+
- py-version: "3.8"
35+
py-tag: "cp38"
36+
py-cmd: "python3.8"
37+
- py-version: "3.9"
38+
py-tag: "cp39"
39+
py-cmd: "python3.9"
40+
- py-version: "3.10"
41+
py-tag: "cp310"
42+
py-cmd: "python3.10"
43+
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v3
47+
with:
48+
submodules: recursive
49+
50+
- name: Python setup
51+
if: ${{ matrix.py-version != '3.8' }}
52+
run: |
53+
apt -y update && apt -y upgrade && apt -y install software-properties-common
54+
add-apt-repository -y ppa:deadsnakes/ppa && apt -y install ${{ matrix.py-cmd }}-dev ${{ matrix.py-cmd }}-distutils
55+
56+
- name: Pip setup
57+
run: |
58+
curl -sS https://bootstrap.pypa.io/get-pip.py | ${{ matrix.py-cmd }}
59+
${{ matrix.py-cmd }} -m pip install --upgrade -r ./requirements/python.txt
60+
61+
- name: Install thirdparty libs
62+
run: ln -s /usr/local/lib/meshlib-thirdparty-lib/lib ./lib
63+
64+
- name: Build
65+
run: ./scripts/build_source.sh
66+
env:
67+
MESHLIB_PYTHON_VERSION: ${{matrix.py-version}}
68+
MESHRUS_BUILD_RELEASE: "ON"
69+
MESHRUS_BUILD_DEBUG: "OFF"
70+
CMAKE_CXX_COMPILER: /usr/bin/g++-10
71+
# not realy needed
72+
CMAKE_C_COMPILER: /usr/bin/gcc-10
73+
74+
- name: Run Tests
75+
run: xvfb-run -a ./build/Release/bin/MeshViewer -hidden -noEventLoop
76+
77+
- name: Unit Tests
78+
run: ./build/Release/bin/MRTest
79+
80+
- name: Python Tests
81+
working-directory: ./build/Release/bin
82+
run: ${{ matrix.py-cmd }} ./../../../scripts/run_python_test_script.py -cmd ${{ matrix.py-cmd }}
83+
84+
- name: Create and fix Wheel
85+
run: |
86+
${{ matrix.py-cmd }} -m pip install auditwheel wheel setuptools
87+
${{ matrix.py-cmd }} ./scripts/wheel/setup_workspace.py
88+
cd ./scripts/wheel/meshlib
89+
${{ matrix.py-cmd }} setup.py bdist_wheel --python-tag=${{matrix.py-tag}} --version ${{needs.setup.outputs.version_tag}}
90+
${{ matrix.py-cmd }} -m auditwheel repair --plat manylinux_2_31_x86_64 ./dist/*.whl
91+
92+
- name: Upload to Test Artifacts
93+
uses: actions/upload-artifact@v3
94+
with:
95+
name: ManyLinux-${{ matrix.py-cmd }}
96+
path: ./scripts/wheel/meshlib/wheelhouse/meshlib-*.whl
97+
retention-days: 1
98+
99+
- name: Upload to Release Artifacts
100+
uses: actions/upload-artifact@v3
101+
with:
102+
name: Wheelhouse
103+
path: ./scripts/wheel/meshlib/wheelhouse/meshlib-*.whl
104+
retention-days: 1
105+
106+
release-tests:
107+
needs: manylinux-pip
108+
uses: MeshInspector/MeshLib/.github/workflows/release-tests.yml@master
109+
110+
upload-to-release:
111+
needs: release-test
112+
timeout-minutes: 10
113+
runs-on: ubuntu-latest
114+
steps:
115+
- name: Download Wheels Artifacts
116+
uses: actions/download-artifact@v3
117+
with:
118+
name: Wheelhouse
119+
120+
- name: Install twine
121+
run: python3 -m pip install --upgrade pip twine
122+
123+
- name: Upload to Production PyPi
124+
run: twine upload ./meshlib-*.whl -u MeshInspector -p ${{ secrets.PIP_TEST_REPO_PASS }} --skip-existing
125+
126+
delete-artifacts:
127+
timeout-minutes: 5
128+
runs-on: ubuntu-20.04
129+
needs: upload-to-release
130+
if: always()
131+
steps:
132+
- name: Delete Wheelhouse
133+
uses: geekyeggo/delete-artifact@v1
134+
with:
135+
name: Wheelhouse
136+
failOnError: false
137+
138+
- name: Delete Python3.8
139+
uses: geekyeggo/delete-artifact@v1
140+
with:
141+
name: ManyLinux-python3.8
142+
failOnError: false
143+
144+
- name: Delete Python3.9
145+
uses: geekyeggo/delete-artifact@v1
146+
with:
147+
name: ManyLinux-python3.9
148+
failOnError: false
149+
150+
- name: Delete Python3.10
151+
uses: geekyeggo/delete-artifact@v1
152+
with:
153+
name: ManyLinux-python3.10
154+
failOnError: false

0 commit comments

Comments
 (0)