-
Notifications
You must be signed in to change notification settings - Fork 269
105 lines (90 loc) · 2.59 KB
/
wheels.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
name: Build CI Wheels
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
paths:
- '.github/workflows/wheels.yml'
workflow_dispatch:
env:
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/tests"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [
ubuntu-latest,
windows-latest,
macos-14,
macos-13,
]
fail-fast: false
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
- name: Fetch all history for all tags and branches
run: |
git fetch --prune --unshallow
- name: Build wheels for CPython
uses: pypa/[email protected]
with:
output-dir: dist
env:
CIBW_BUILD: "cp310-* cp311-* cp312*"
CIBW_SKIP: "*-musllinux_*" # numpy doesn't have wheels for musllinux so we can't build some quickly and without bloating
CIBW_ARCHS_LINUX: "x86_64"
MACOSX_DEPLOYMENT_TARGET: "10.9" # as of CIBW 2.9, this is the default value, pin it so it can't be bumped silently
CIBW_ARCHS_WINDOWS: "auto64"
CIBW_BUILD_VERBOSITY: 1
CIBW_ENVIRONMENT: PIP_ONLY_BINARY=":all:"
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./dist/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
deploy:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v-'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Download sdist
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Download wheels
uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}