-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (79 loc) · 3.19 KB
/
pypi.yml
File metadata and controls
93 lines (79 loc) · 3.19 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
87
88
89
90
91
92
93
name: Build and Publish to PyPI
on:
push:
tags:
- 'v*' # Triggers when you push a tag like v0.1.0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13" # Used for bootstrapping cibuildwheel
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel delocate auditwheel build numpy scikit-build-core pybind11 twine
- name: Configure pkg-config path (Linux)
if: runner.os == 'Linux'
run: echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
- name: Set macOS deployment target
if: runner.os == 'macOS'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV
echo "CMAKE_OSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV
- name: Configure pkg-config path (macOS)
if: runner.os == 'macOS'
run: echo "PKG_CONFIG_PATH=$(brew --prefix)/lib/pkgconfig" >> $GITHUB_ENV
- name: Install HDF5 via Homebrew (macOS)
if: runner.os == 'macOS'
run: |
brew install hdf5 pkg-config
- name: Setup HDF5 for Windows
if: runner.os == 'Windows'
shell: powershell
run: scripts/setup_hdf5_windows.ps1
- name: Build wheels
env:
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*"
CIBW_SKIP: "*-manylinux_i686 *-musllinux* *-win32 *-pp*"
CIBW_BEFORE_ALL_LINUX: >
yum install -y epel-release &&
yum install -y openmpi-devel hdf5-devel pkgconfig &&
export PATH=/usr/lib64/openmpi/bin:$PATH &&
ln -sf /usr/lib64/openmpi/bin/mpicc /usr/local/bin/mpicc &&
ln -sf /usr/lib64/openmpi/bin/mpicxx /usr/local/bin/mpicxx &&
find /usr -name mpicc &&
find /usr -name hdf5.h &&
find /usr -name libhdf5.so
CIBW_ENVIRONMENT_LINUX: >
CC=/usr/lib64/openmpi/bin/mpicc
CXX=/usr/lib64/openmpi/bin/mpicxx
PATH=/usr/lib64/openmpi/bin:$PATH
CMAKE_PREFIX_PATH="/usr/lib64/openmpi:/usr"
CMAKE_INCLUDE_PATH="/usr/include"
CMAKE_LIBRARY_PATH="/usr/lib64"
CIBW_ENVIRONMENT_WINDOWS: >
HDF5_C_LIBRARY=%HDF5_C_LIBRARY%
HDF5_INCLUDE_DIR=%HDF5_INCLUDE_DIR%
CMAKE_PREFIX_PATH=%HDF5_ROOT%
CMAKE_INCLUDE_PATH=%HDF5_INCLUDE_DIR%
CMAKE_LIBRARY_PATH=%HDF5_ROOT%\lib
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
bash scripts/repair_macos_wheel.sh {wheel} {dest_dir}
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
auditwheel repair -w {dest_dir} {wheel}
run: python -m cibuildwheel --output-dir wheelhouse
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/v')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m pip install twine
twine upload wheelhouse/*