forked from capnproto/pycapnp
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (98 loc) · 3.38 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
108
109
110
111
112
113
114
115
116
name: Build
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 99
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-latest
arch: i686
- os: ubuntu-latest
arch: aarch64
- os: ubuntu-latest
arch: ppc64le
- os: ubuntu-latest
arch: s390x
- os: macOS-latest
arch: x86_64
- os: macOS-latest
arch: arm64
# Disabled until someone figures out how to build capnproto for arm64 and x86_64 simultaneously
# - os: macOS-latest
# arch: universal2
- os: windows-2019
arch: AMD64
- os: windows-2019
arch: x86
# Does not build currently
# - os: windows-2019
# arch: ARM64
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
# Used to host cibuildwheel
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.1
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: ${{ matrix.arch }}
# TODO: Disable building PyPy wheels. If the build system gets modernized, this should be
# auto-detected based on the Cython dependency.
CIBW_SKIP: pp*
CIBW_TEST_REQUIRES: pytest pytest-asyncio
CIBW_TEST_COMMAND: pytest {project}
# Only needed to make the macosx arm64 build work
CMAKE_OSX_ARCHITECTURES: "${{ matrix.arch == 'arm64' && 'arm64' || '' }}"
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
lint:
name: Lint with flake8 and check black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint with flake8 and check black
run: |
pip install black flake8
flake8 . --filename '*.py,*.pyx,*.pxd' --count --show-source --statistics --exclude benchmark,build,capnp/templates/module.pyx
flake8 . --count --show-source --statistics --exclude benchmark,build
black . --check --diff --color
# upload_pypi:
# needs: [build_wheels, build_sdist]
# runs-on: ubuntu-latest
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# steps:
# - uses: actions/download-artifact@v3
# with:
# # unpacks default artifact into dist/
# # if `name: artifact` is omitted, the action will create extra parent dir
# name: artifact
# path: dist
# - uses: pypa/[email protected]
# with:
# user: __token__
# password: ${{ secrets.PYPI_PASSWORD_RELEASE }}
# # password: ${{ secrets.PYPI_PASSWORD }}
# # repository_url: https://test.pypi.org/legacy/