-
Notifications
You must be signed in to change notification settings - Fork 73
116 lines (113 loc) · 3.3 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: Wheel-Builder
on:
workflow_call:
inputs:
pypi-repository:
required: false
type: string
secrets:
pypi-username:
required: false
pypi-password:
required: false
permissions: {}
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}_${{ matrix.archs }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
archs: [x86_64, i686, aarch64, ppc64le, s390x]
build: [manylinux, musllinux]
include:
- os: windows-2022
archs: AMD64
- os: windows-2022
archs: x86
- os: windows-2022
archs: ARM64
- os: macOS-13
archs: x86_64
- os: macOS-14
archs: arm64
- os: macOS-14
archs: universal2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: wheelhouse
env:
CIBW_BUILD: "{cp38,cp39,cp310,cp311,cp312,cp313}-${{ matrix.build }}*"
CIBW_SKIP: cp38-win_arm64
CIBW_ARCHS: ${{ matrix.archs }}
CIBW_BUILD_FRONTEND: "build"
CIBW_TEST_REQUIRES: "pytest"
CIBW_TEST_COMMAND: "pytest {project}"
CIBW_TEST_SKIP: "*-win_arm64 cp38-macosx_*:arm64"
- uses: actions/upload-artifact@v4
with:
name: Wheel-${{ matrix.os }}-${{ matrix.build }}${{ matrix.archs }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build a source distribution
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build sdist
run: |
python -m pip install --upgrade pip
pip install setuptools build
python -m build --sdist
- name: Test building from the source distribution
shell: bash
run: |
pip install ".[test,type]"
pip uninstall -y mmh3
python -m pip install dist/*.tar.gz
python -m pytest
mypy --strict tests
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
publish:
if: ${{ inputs.pypi-repository == 'pypi' || inputs.pypi-repository == 'testpypi'}}
name: "Upload to PyPI/Test PyPI"
runs-on: ubuntu-22.04
needs: [build_wheels, build_sdist]
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up built items
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: "Publish"
env:
TWINE_USERNAME: ${{ secrets.pypi-username }}
TWINE_PASSWORD: ${{ secrets.pypi-password }}
run: |
twine upload --repository ${{ inputs.pypi-repository }} dist/*