-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (76 loc) · 2.79 KB
/
build-wheels.yml
File metadata and controls
86 lines (76 loc) · 2.79 KB
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
name: build-wheels
on:
workflow_call:
inputs:
os:
description: "OS to run on, must be one of supported runner type"
required: true
type: string
build-target:
description: "CIBW build target (e.g., cp310-manylinux_x86_64)"
required: true
type: string
python-version:
description: "CIBW build target (e.g., 3.10)"
required: true
type: string
platform-tag:
description: "Wheel platform tag to apply after building."
required: true
type: string
jobs:
build-test:
runs-on: ${{ inputs.os }}
env:
PIP_EXTRA_INDEX_URL: "https://vtk.org/files/wheel-sdks"
CIBW_ENVIRONMENT_PASS_LINUX: "PIP_EXTRA_INDEX_URL"
CIBW_BUILD: ${{ inputs.build-target }}
# Required to make tests pass (VTK needs them)
CIBW_BEFORE_ALL_LINUX: "yum install -y mesa-libGL-devel glx-utils freeglut-devel"
# Global test setup
CIBW_TEST_REQUIRES: "pytest virtualenv"
# Do not repair, everything is already put just as needed to make it work
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "
python -m pip install wheel &&
python -m wheel tags --platform-tag ${{ inputs.platform-tag }} --remove {wheel} &&
cp $(dirname {wheel})/slicer_layer_dm*.whl {dest_dir}"
# same as above, we don't patch the wheel on Mac too.
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "
python -m pip install wheel &&
python -m wheel tags --platform-tag ${{ inputs.platform-tag }} --remove {wheel} &&
cp $(dirname {wheel})/slicer_layer_dm*.whl {dest_dir}"
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true # tags are used to determine wheel version
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
# Required to use MSVC with Ninja
- uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Build wheel
uses: pypa/cibuildwheel@v3.3.1
env:
CIBW_TEST_COMMAND: "python -m pytest {project}/LayerDM -m runtime --verbose"
with:
package-dir: LayerDM
output-dir: wheelhouse
- name: Build wheel SDK
uses: pypa/cibuildwheel@v3.3.1
env:
CIBW_TEST_COMMAND: "python -m pytest {project}/LayerDM -m sdk --verbose"
with:
package-dir: LayerDMSDK
output-dir: wheelhouse
- name: Upload runtime wheels
uses: actions/upload-artifact@v4
with:
name: slicer_layer_dm-${{ inputs.build-target }}
path: |
wheelhouse/slicer_layer_dm-*.whl
- name: Upload SDK wheels
uses: actions/upload-artifact@v4
with:
name: slicer_layer_dm_sdk-${{ inputs.build-target }}
path: |
wheelhouse/slicer_layer_dm_sdk-*.whl