-
Notifications
You must be signed in to change notification settings - Fork 27
181 lines (146 loc) · 5.25 KB
/
python_build_ci.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
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
name: Mt-KaHyPar Python Package
on:
push
jobs:
package_linux_x86:
name: Python Package Linux x86
runs-on: ubuntu-24.04
env:
CI_ACTIVE : 1
TBB_INSTALL_DIR: /tmp/tbb_build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install Dependencies
run: |
sudo apt-get install libtbb-dev libhwloc-dev libboost-program-options-dev
python3 -m pip install cibuildwheel>=2.22.0
- name: Build Python Wheels
env:
CIBW_ARCHS_LINUX: x86_64
CIBW_BUILD: cp3*-manylinux*
run: |
# run cmake to create pyproject.toml from pyproject.toml.in
cmake -B configure_python --preset=minimal -DKAHYPAR_SETUP_PYTHON=On -DKAHYPAR_TBB_DIR=$TBB_INSTALL_DIR -DKAHYPAR_DISABLE_HWLOC=Off
rm -rf configure_python
python3 -m cibuildwheel --output-dir wheels
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-ubuntu-24.04
path: ./wheels/*.whl
# package_linux_arm_1:
# name: Python Package Linux ARM 1
# runs-on: ubuntu-24.04
# env:
# CI_ACTIVE : 1
# TBB_INSTALL_DIR: /tmp/tbb_build
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# with:
# platforms: all
# - name: Install Dependencies
# run: |
# sudo apt-get install libtbb-dev libhwloc-dev libboost-program-options-dev
# python3 -m pip install cibuildwheel>=2.22.0
# - name: Build Python Wheels
# env:
# CIBW_ARCHS_LINUX: aarch64
# CIBW_BUILD: cp3{9,10,11}-manylinux*
# run: |
# # run cmake to create pyproject.toml from pyproject.toml.in
# cmake -B configure_python --preset=minimal -DKAHYPAR_SETUP_PYTHON=On -DKAHYPAR_TBB_DIR=$TBB_INSTALL_DIR -DKAHYPAR_DISABLE_HWLOC=Off
# rm -rf configure_python
# python3 -m cibuildwheel --output-dir wheels
# - uses: actions/upload-artifact@v4
# with:
# name: cibw-wheels-ubuntu-24.04-arm1
# path: ./wheels/*.whl
# package_linux_arm_2:
# name: Python Package Linux ARM 2
# runs-on: ubuntu-24.04
# env:
# CI_ACTIVE : 1
# TBB_INSTALL_DIR: /tmp/tbb_build
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# with:
# platforms: all
# - name: Install Dependencies
# run: |
# sudo apt-get install libtbb-dev libhwloc-dev libboost-program-options-dev
# python3 -m pip install cibuildwheel>=2.22.0
# - name: Build Python Wheels
# env:
# CIBW_ARCHS_LINUX: aarch64
# CIBW_BUILD: cp3*-manylinux*
# CIBW_PROJECT_REQUIRES_PYTHON: ">=3.12"
# run: |
# # run cmake to create pyproject.toml from pyproject.toml.in
# cmake -B configure_python --preset=minimal -DKAHYPAR_SETUP_PYTHON=On -DKAHYPAR_TBB_DIR=$TBB_INSTALL_DIR -DKAHYPAR_DISABLE_HWLOC=Off
# rm -rf configure_python
# python3 -m cibuildwheel --output-dir wheels
# - uses: actions/upload-artifact@v4
# with:
# name: cibw-wheels-ubuntu-24.04-arm2
# path: ./wheels/*.whl
# package_macos:
# name: Python Package MacOS
# runs-on: macos-latest
# env:
# CI_ACTIVE : 1
# TBB_INSTALL_DIR: /tmp/tbb_build
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# - name: Install Dependencies
# run: |
# brew install tbb boost pipx
# - name: Build Python Wheels
# env:
# CIBW_ARCHS_MACOS: x86_64 arm64
# CIBW_BUILD: cp3*-macos*
# # TBB doesn't compile on older MacOS than 10.13
# MACOSX_DEPLOYMENT_TARGET: 10.13
# run: |
# # run cmake to create pyproject.toml from pyproject.toml.in
# cmake -B configure_python --preset=minimal -DKAHYPAR_SETUP_PYTHON=On -DKAHYPAR_TBB_DIR=$TBB_INSTALL_DIR -DKAHYPAR_DISABLE_HWLOC=On
# rm -rf configure_python
# pipx run cibuildwheel --output-dir wheels
# - uses: actions/upload-artifact@v4
# with:
# name: cibw-wheels-macos
# path: ./wheels/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [package_linux_x86, build_sdist] # package_linux_arm_1, package_linux_arm_2, package_macos, build_sdist]
runs-on: ubuntu-24.04
environment: testpypi
permissions:
id-token: write
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/