-
Notifications
You must be signed in to change notification settings - Fork 2
129 lines (110 loc) · 3.43 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
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@v3
with:
submodules: true # Optional, use if you have submodules
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_macos_wheel:
name: Build MacOS 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"
steps:
- name: Checkout CyRK
uses: actions/checkout@v3
- name: Install Anaconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: cyrk_test
auto-update-conda: true
python-version: ${{ matrix.python }}
auto-activate-base: false
- name: Conda info
shell: bash -el {0}
run: conda info
- name: Install llvm and libomp
shell: bash -el {0}
run: |
brew reinstall llvm libomp
- name: Install Dependencies
shell: bash -el {0}
run: |
conda install numpy scipy cython llvm-openmp pytest
python -m pip install --upgrade build
- name: Install package
shell: bash -el {0}
run: |
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
export PATH="/usr/local/opt/llvm/bin:$PATH"
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp -I/usr/local/opt/llvm/include"
export CFLAGS="$CFLAGS -I/usr/local/opt/libomp/include"
export CXXFLAGS="$CXXFLAGS -I/usr/local/opt/libomp/include"
export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp -L/usr/local/opt/llvm/lib"
python -m build --wheel --outdir ./wheelhouse/
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.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
- ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build wheels
uses: pypa/cibuildwheel@v2.14.1
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
check_dist:
name: Check dist
needs: [make_sdist, build_macos_wheel, build_other_wheels]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- run: pipx run twine check --strict dist/*
upload_all:
name: Upload wheels to PyPI
needs: [build_macos_wheel, build_other_wheels, make_sdist, check_dist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.8.8
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}