-
Notifications
You must be signed in to change notification settings - Fork 126
107 lines (95 loc) · 2.76 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
106
107
name: Build wheel
on:
workflow_dispatch:
push:
# Pattern matched against refs/tags
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
env:
CIBW_BUILD_VERBOSITY: 1
# Run the package tests using `pytest`
# CIBW_TEST_REQUIRES: pytest
# CIBW_TEST_COMMAND: pytest
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install deps
run: python -m pip install build twine
- name: Build SDist
run: python -m build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
- name: Check metadata
run: twine check dist/*
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
# Used to host cibuildwheel
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
# Disable building PyPy wheels
CIBW_SKIP: "pp* cp313* cp312*i686"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_PRERELEASE_PYTHONS: False
- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
build_aarch64_wheels:
name: Build wheels manylinux_aarch64
runs-on: ubuntu-latest
strategy:
matrix:
python: [37, 38, 39, 310, 311, 312]
include:
- os: ubuntu-latest
arch: aarch64
platform_id: manylinux_aarch64
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS_LINUX: ${{matrix.arch}}
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
upload_pypi:
name: Upload to PyPI (prod)
needs: [build_wheels, build_aarch64_wheels, make_sdist]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}