-
-
Notifications
You must be signed in to change notification settings - Fork 9
116 lines (99 loc) · 3.37 KB
/
python-package.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
name: Build and Publish Python Package
on:
push:
branches: [ "Master" ]
pull_request:
branches: [ "Master" ]
jobs:
build_wheels:
name: Build wheel ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
# Github Actions doesn't support pairing matrix values together, let's improvise
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
buildplat:
- [ubuntu-22.04, manylinux_x86_64, ""]
- [ubuntu-22.04, musllinux_x86_64, ""]
- [macos-13, macosx_x86_64, openblas]
# targeting macos >= 14. Could probably build on macos-14, but it would be a cross-compile
- [macos-13, macosx_x86_64, accelerate]
- [macos-14, macosx_arm64, accelerate] # always use accelerate
- [windows-2019, win_amd64, ""]
- [windows-2019, win32, ""]
python: ["cp310", "cp311", "cp312", "pp310", "cp313", "cp313t"]
exclude:
# Don't build PyPy 32-bit windows
- buildplat: [windows-2019, win32, ""]
python: "pp310"
- buildplat: [ ubuntu-22.04, musllinux_x86_64, "" ]
python: "pp310"
- buildplat: [ macos-14, macosx_arm64, accelerate ]
python: "pp310"
- buildplat: [ windows-2019, win_amd64, "" ]
python: "cp313t"
- buildplat: [ windows-2019, win32, "" ]
python: "cp313t"
- buildplat: [ macos13, macosx_x86_64, openblas ]
python: "cp313t"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Print Python version info
run: |
python --version
python -c "import sys; print(sys.executable)"
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel==2.16.2
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: cp36-* pp*
CIBW_BEFORE_BUILD: >
pip install cmake setuptools_scm[toml] wheel pybind11
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Build sdist
run: |
python -m pip install -U pip build
python -m build --sdist -Csetup-args=-Dallow-noblas=true
- name: Check README rendering for PyPI
run: |
python -mpip install twine
twine check dist/*
- uses: actions/upload-artifact@v3
with:
path: ./dist/*
upload_pypi:
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: List Build contents
run: ls -l dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true