-
Notifications
You must be signed in to change notification settings - Fork 4
139 lines (121 loc) · 4.13 KB
/
build-whl-cibuild.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
name: Build CIBuild and Upload Wheels
on:
workflow_dispatch:
inputs:
test_py:
description: 'Publish package to test PY Repository'
required: true
default: 'false'
main_py:
description: 'Publish package to main PY Repository'
required: true
default: 'false'
test_package:
description: 'Test package within workflow'
required: true
default: 'false'
jobs:
build:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-12]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
# Used to host cibuildwheel
- uses: actions/setup-python@v4
with:
python-version: 3.10
# macOS workaround to not use Accelerate:
# https://github.com/numpy/numpy/issues/15947
- name: Setup Openblas on macOS
if: matrix.os == 'macOS-12'
run: brew install openblas
- name: Install dependencies and cibuildwheel
run: |
python -m pip install cibuildwheel==2.16.0
python -m pip install -r requirements-dev.txt
- name: Build wheels MACOS
if: matrix.os == 'macOS-12'
run: OPENBLAS="$(brew --prefix openblas)" python -m cibuildwheel --output-dir dist
env:
# Disable building PyPy wheels on all platforms: "pp*
# Disable 32-bit compilation: *-win32
# Disable musllinux: *-musllinux*
# Disable cp312 for now: cp312-*"
# Windows workaround to avoid setuptools error:
# https://github.com/duckdb/duckdb/pull/3376
CIBW_SKIP: "pp* *-win32 *-manylinux_i686 *-musllinux* cp36-* cp37-* cp312-*"
if: matrix.os == 'windows-2019'
SETUPTOOLS_USE_DISTUTILS: 'stdlib'
- name: Build wheels Non-MACOS
if: matrix.os != 'macOS-12'
run: python -m cibuildwheel --output-dir dist
env:
# Disable building PyPy wheels on all platforms: "pp*
# Disable 32-bit compilation: *-win32
# Disable musllinux: *-musllinux*
# Disable cp312 for now: cp312-*"
# Windows workaround to avoid setuptools error:
# https://github.com/duckdb/duckdb/pull/3376
CIBW_SKIP: "pp* *-win32 *-manylinux_i686 *-musllinux* cp36-* cp37-* cp312-*"
if: matrix.os == 'windows-2019'
SETUPTOOLS_USE_DISTUTILS: 'stdlib'
- uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist/*.whl
if-no-files-found: error
- name: Install software
if: ${{ github.event.inputs.test_package == 'true' }}
run: pip install --find-links=${{github.workspace}}/dist/ numpymaxflow
- name: Test import
if: ${{ github.event.inputs.test_package == 'true' }}
run: python -c "import numpymaxflow"
build_sdist:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.10
- name: Install dependencies
run: |
pip install wheel setuptools
pip install -r requirements-dev.txt
- name: Build source dist
run: python setup.py sdist
- name: Upload Python Dist
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
if-no-files-found: error
publish_pypi:
runs-on: ubuntu-20.04
needs:
- build
- build_sdist
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Publish distribution to Test PyPI
if: ${{ github.event.inputs.test_py == 'true' }}
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: ${{ github.event.inputs.main_py == 'true' }}
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}