-
Notifications
You must be signed in to change notification settings - Fork 11
132 lines (112 loc) · 4.56 KB
/
build-wheel.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Create Python wheel using Conda
on:
workflow_dispatch
# push:
# branches: [ master ]
env:
PYTHONUTF8: 1
jobs:
build:
name: Build for python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-22.04', 'macos-13', 'windows-2019' ]
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
steps:
# see https://github.com/marketplace/actions/download-workflow-artifact
# - name: Download artifact
# uses: dawidd6/action-download-artifact@v2
# if: ${{ matrix.os == 'ubuntu-22.04' }}
# with:
# workflow: build-vtk.yml
# path: /tmp/vtk-wheels
# - name: List downloaded wheels
# if: ${{ matrix.os == 'ubuntu-22.04' }}
# run: |
# find /tmp/vtk-wheels -ls
# ls -ld /tmp/vtk-wheels/*-cp${{ matrix.python-version }}/vtk-*.whl
- name: Checkout project
uses: actions/checkout@v4
# See https://cibuildwheel.readthedocs.io/en/stable/
# Not usable for now, because cadquery libraries require glibc 2.31,
# but the manylinux images have been created only up to 2.24 (as of 2022-04-11).
# - name: Build wheels
# uses: pypa/[email protected]
# with:
# output-dir: dist
# see https://github.com/marketplace/actions/setup-miniconda
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
#miniforge-version: latest
miniconda-version: latest
activate-environment: cadquery-ocp
python-version: ${{ matrix.python-version }}
channels: cadquery, conda-forge, defaults
- name: Ubuntu Deps Setup
shell: bash -l {0}
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update
sudo apt install -y libegl1 libegl1-mesa-dev
fi
- name: Conda Deps Setup
if: ${{ matrix.os != 'ubuntu-22.04' }}
shell: bash -l {0}
run: |
conda install -c cadquery -n cadquery-ocp -y ocp=7.7.2.* vtk=9.2.*
- name: Conda Deps Setup Linux
if: ${{ matrix.os == 'ubuntu-22.04' }}
shell: bash -l {0}
run: |
conda install -c cadquery -n cadquery-ocp -y ocp=7.7.2.* vtk=9.2.* occt=7.7.2=all* auditwheel
# Save ~100MiB in shared object size by stripping debugging symbols.
# See https://github.com/CadQuery/ocp-build-system/issues/33 for details.
echo "Before stripping:"
ls -l ~/conda_pkgs_dir/ocp-*/lib/python*/site-packages/OCP*.so /usr/share/miniconda3/envs/cadquery-ocp/lib/python*/site-packages/OCP*.so
strip ~/conda_pkgs_dir/ocp-*/lib/python*/site-packages/OCP*.so /usr/share/miniconda3/envs/cadquery-ocp/lib/python*/site-packages/OCP*.so
echo "After stripping:"
ls -l ~/conda_pkgs_dir/ocp-*/lib/python*/site-packages/OCP*.so /usr/share/miniconda3/envs/cadquery-ocp/lib/python*/site-packages/OCP*.so
- name: Pip Deps Setup 1
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install build setuptools wheel requests delocate delvewheel
- name: Pip Deps Setup 2
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
pip install auditwheel patchelf
# - name: Manylinux Build 1
# shell: bash -l {0}
# if: ${{ matrix.os == 'ubuntu-22.04' }}
# run: |
# export VTK_MANYLINUX=/tmp/vtk-manylinux
# pip install -t $VTK_MANYLINUX --no-deps /tmp/vtk-wheels/*-cp${{ matrix.python-version }}/vtk-*.whl
# python -m build --no-isolation --wheel
- name: Conda-only Build
shell: bash -l {0}
run: |
python -m build --no-isolation --wheel
- name: Print info
shell: bash -l {0}
run: |
conda info
conda list --explicit
echo '${{ github.event_name }} ${{ github.ref }}'
# - name: Test wheel
# shell: bash -l {0}
# run: |
# conda deactivate
# conda create --yes -n cadquerytest python=${{ matrix.python-version }}
# conda activate cadquerytest
# ls dist/*
# pip install dist/*.whl
# python -c "import OCP;print('OCP imported successfully')"
# see https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: cadquery-ocp-${{ matrix.os }}-cp${{ matrix.python-version }}
path: dist/*.whl