-
Notifications
You must be signed in to change notification settings - Fork 2
170 lines (147 loc) · 4.6 KB
/
build_wheels_main_pypi.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
name: Build Wheels for PyPI
on:
workflow_dispatch:
release:
types:
- published
jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true # Optional, use if you have submodules
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: artifact_sdist
build_macos_latest_wheel:
name: Build MacOS (latest) wheel for Python ${{ matrix.python }}
runs-on: macos-latest
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- name: Checkout CyRK
uses: actions/checkout@v4
- name: Install Anaconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: cyrk_macos_latest_wheels
auto-update-conda: true
python-version: ${{ matrix.python }}
auto-activate-base: false
- name: Conda info
shell: bash -el {0}
run: conda info
- name: Install package
shell: bash -el {0}
run: |
conda install pytest matplotlib numba numpy scipy cython
python -m pip install --upgrade build
export CC=gcc
export CXX=gcc
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp -lgomp"
python -m build --wheel --outdir ./wheelhouse/
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: artifact_MacosLatest_${{ matrix.python }}_whl
build_macos_13_wheel:
name: Build MacOS-13 (x64-86) wheel for Python ${{ matrix.python }}
runs-on: macos-13
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- name: Checkout CyRK
uses: actions/checkout@v4
- name: Install Anaconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: cyrk_macos_13_wheels
auto-update-conda: true
python-version: ${{ matrix.python }}
auto-activate-base: false
- name: Conda info
shell: bash -el {0}
run: conda info
- name: install gcc-13 # openMP does not play nice with clang on MacOS; also some versions of macos use older gcc so there is a need to install latest.
shell: bash -el {0}
run: |
brew install gcc@13
- name: Install package
shell: bash -el {0}
run: |
conda install nomkl
conda install pytest matplotlib numba numpy scipy cython
python -m pip install --upgrade build
export CC=gcc
export CXX=gcc
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp -lgomp"
python -m build --wheel --outdir ./wheelhouse/
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: artifact_Macos13_${{ matrix.python }}_whl
build_other_wheels:
name: Build ${{ matrix.platform }} wheels
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
# - macos-12 ## macos is not playing nice with cibuildwheel with openmp from cython.
- windows-2022
- windows-latest
- ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: artifact_${{ matrix.platform }}_whls
check_dist:
name: Check sdist
needs: [make_sdist, build_macos_latest_wheel, build_macos_13_wheel, build_other_wheels]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
name: artifact_sdist
path: sdist
- run: pipx run twine check --strict sdist/*
upload_all:
name: Upload wheels to PyPI
needs: [build_macos_latest_wheel, build_macos_13_wheel, build_other_wheels, make_sdist, check_dist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@v1.9.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}