-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (86 loc) · 3.29 KB
/
build-wheel-and-repair.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
name: Create Python Wheel and Repair
on:
workflow_dispatch
jobs:
build:
name: Build for python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [ 'ubuntu-22.04', 'macos-13', 'macos-14', 'windows-2019' ] # macos-14 is arm64
# python-version: [ '3.9', '3.10', '3.11', '3.12' ]
os: [ 'windows-2019' ] # macos-14 is arm64
python-version: [ '3.11' ]
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: env.yml # located in same dir, by default
environment-name: ocp-addons # required by micromamba
create-args: >-
python=${{ matrix.python-version }}
- name: Install Linux Dependencies (x86_64)
if: ${{ matrix.os == 'ubuntu-22.04' }}
shell: bash -l {0}
run: |
sudo apt-get update
sudo apt-get install freetype* libfreetype6-dev libgl1-mesa-glx
micromamba install -c conda-forge gxx_linux-64=12
pip install auditwheel patchelf
micromamba info
micromamba list
- name: Install MacOS Dependencies (x86_64 / arm64)
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14'}}
shell: bash -l {0}
run: |
brew install automake
pip install delocate
- name: Install Windows Dependencies (x86_64)
if: ${{ matrix.os == 'windows-2019' }}
shell: bash -l {0}
run: |
micromamba install vs2019_win-64 -c conda-forge
pip install delvewheel
micromamba info
micromamba list
- name: Build Wheel
shell: bash -l {0}
run: |
python -m build -n
- name: Repair Linux Wheel (x86_64) # TODO: eliminate hardcoded GLIBC ver
if: ${{ matrix.os == 'ubuntu-22.04' }}
shell: bash -l {0}
run: |
auditwheel repair --plat manylinux_2_35_x86_64 dist/ocp_addons-*.whl
- name: Repair MacOS Wheel (x86_64 / arm64)
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14'}}
shell: bash -l {0}
run: |
DYLD_LIBRARY_PATH=$CONDA_PREFIX/lib python -m delocate.cmd.delocate_wheel --wheel-dir=wheelhouse dist/ocp_addons*.whl
- name: Repair Windows Wheel (x86_64)
if: ${{ matrix.os == 'windows-2019' }}
shell: bash -l {0}
run: |
python -m delvewheel repair --wheel-dir=wheelhouse dist/ocp_addons*.whl
- name: Test Repaired Wheel and Run Package Tests
shell: bash -l {0}
run: |
micromamba deactivate
micromamba create --name ocpaddonstest python=${{ matrix.python-version }} --file env.yml --yes
micromamba activate ocpaddonstest
micromamba info --envs
ls wheelhouse/*
pip install wheelhouse/ocp_addons*.whl
micromamba list
python -c "import ocp_addons;print('ocp_addons imported successfully')"
python test.py
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ocp_addons-${{ matrix.os }}-cp${{ matrix.python-version }}
path: |
wheelhouse/*.whl
dist/