-
Notifications
You must be signed in to change notification settings - Fork 0
192 lines (171 loc) · 6.79 KB
/
build_wheels.yml
File metadata and controls
192 lines (171 loc) · 6.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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: "Build Wheels"
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
release:
types:
- published
jobs:
build_wheels:
name: Build Python Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]
python_version: ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Ubuntu Dependencies
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: |
sudo apt update
sudo apt install -y wget gfortran cmake ninja-build libboost-all-dev libzip-dev libhdf5-dev libbz2-dev libssl-dev liblzma-dev
# for some reason, there aren't headers included in libzip-dev???? so we're building from source!
mkdir ../libzip-source
wget https://libzip.org/download/libzip-1.11.3.tar.gz
tar -xzvf libzip-1.11.3.tar.gz -C ../libzip-source
cmake -S ../libzip-source/libzip-1.11.3 -B ../libzip-source/libzip-1.11.3/build -G Ninja
cmake --build ../libzip-source/libzip-1.11.3/build
sudo cmake --install ../libzip-source/libzip-1.11.3/build
echo "Confirming header presence..."
- name: Install Intel MacOS Dependencies
if: matrix.os == 'macos-13'
shell: bash
run: |
brew install boost
brew install hdf5
brew install libzip
brew install ninja
brew install libaec
brew install llvm
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> /Users/runner/.bash_profile
source /Users/runner/.bash_profile
ln -s $(which gfortran-14) /usr/local/bin/gfortran
- name: Install ARM MacOS dependencies
if: matrix.os == 'macos-14'
shell: bash
run: |
brew install boost
brew install hdf5
brew install libzip
brew install ninja
brew install libaec
brew install llvm
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> /Users/runner/.bash_profile
ln -s /opt/homebrew/bin/gfortran-14 /usr/local/bin/gfortran
- name: Install Windows Dependencies
if: matrix.os == 'windows-latest'
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
choco install ninja
choco install msys2
C:\tools\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm \
mingw-w64-clang-x86_64-cmake \
mingw-w64-clang-x86_64-ninja \
mingw-w64-clang-x86_64-toolchain \
mingw-w64-clang-x86_64-boost \
mingw-w64-clang-x86_64-hdf5 \
mingw-w64-clang-x86_64-zlib \
mingw-w64-clang-x86_64-libaec"
echo "C:\tools\msys64\mingw64\bin" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
echo "C:\tools\msys64\clang64\bin" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
echo "C:\tools\msys64\clang64\lib" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
echo "C:\tools\msys64\clang64\include" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
- name: Build Wheels (Windows)
uses: pypa/cibuildwheel@v2.23.2
if: matrix.os == 'windows-latest'
env:
CIBW_BUILD: ${{ matrix.python_version }}
CIBW_BEFORE_BUILD: "pip install cmake ninja"
CIBW_ENVIRONMENT: >
CC=clang
CXX=clang++
CMAKE_GENERATOR=Ninja
# with:
# package-dir: .
# output-dir: wheelhouse
# config-file: "{package}/pyproject.toml"
- name: Build Wheels (MacOS<x86_64>)
uses: pypa/cibuildwheel@v2.23.2
if: matrix.os == 'macos-13'
env:
CIBW_BUILD: ${{ matrix.python_version }}
CIBW_ENVIRONMENT: >
FC=/usr/local/bin/gfortran
# with:
# package-dir: .
# output-dir: wheelhouse
# config-file: "{package}/pyproject.toml"
- name: Build Wheels (MacOS<ARM>)
uses: pypa/cibuildwheel@v2.23.2
if: matrix.os == 'macos-14'
env:
MACOSX_DEPLOYMENT_TARGET: 14.0
CIBW_BUILD: ${{ matrix.python_version }}
CIBW_ENVIRONMENT: >
FC=/opt/homebrew/bin/gfortran-14
# with:
# package-dir: .
# output-dir: wheelhouse
# config-file: "{package}/pyproject.toml"
- name: Build Wheels (Linux<ARM>)
uses: pypa/cibuildwheel@v2.23.2
if: matrix.os == 'ubuntu-24.04-arm'
env:
CIBW_BUILD: ${{ matrix.python_version }}
CIBW_BEFORE_BUILD: "pip install h5py && export LIBZIP_INCLUDE_DIR=/usr/local/include && export LIBZIP_LIBRARY=/usr/local/lib/libzip.so"
# with:
# package-dir: .
# output-dir: wheelhouse
# config-file: "{package}/pyproject.toml"
- name: Build Wheels (Linux<x86_64>)
uses: pypa/cibuildwheel@v2.23.2
if: matrix.os == 'ubuntu-latest'
env:
CIBW_BUILD: ${{ matrix.python_version }}
CIBW_BEFORE_BUILD: "pip install h5py && export LIBZIP_INCLUDE_DIR=/usr/local/include && export LIBZIP_LIBRARY=/usr/local/lib/libzip.so"
# with:
# package-dir: .
# output-dir: wheelhouse
# config-file: "{package}/pyproject.toml"
- name: Upload Artifact (Python 3.9)
uses: actions/upload-artifact@v4
if: matrix.python_version == 'cp39-*'
with:
name: pyvcell-fv-${{ matrix.os }}-cp39-cibw-wheels
path: ./wheelhouse/*.whl
- name: Upload Artifact (Python 3.10)
uses: actions/upload-artifact@v4
if: matrix.python_version == 'cp310-*'
with:
name: pyvcell-fv-${{ matrix.os }}-cp310-cibw-wheels
path: ./wheelhouse/*.whl
- name: Upload Artifact (Python 3.11)
uses: actions/upload-artifact@v4
if: matrix.python_version == 'cp311-*'
with:
name: pyvcell-fv-${{ matrix.os }}-cp311-cibw-wheels
path: ./wheelhouse/*.whl
- name: Upload Artifact (Python 3.12)
uses: actions/upload-artifact@v4
if: matrix.python_version == 'cp312-*'
with:
name: pyvcell-fv-${{ matrix.os }}-cp312-cibw-wheels
path: ./wheelhouse/*.whl
- name: Upload Artifact (Python 3.13)
uses: actions/upload-artifact@v4
if: matrix.python_version == 'cp313-*'
with:
name: pyvcell-fv-${{ matrix.os }}-cp313-cibw-wheels
path: ./wheelhouse/*.whl
- name: Setup tmate session on failure
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}
with:
limit-access-to-actor: true