-
Notifications
You must be signed in to change notification settings - Fork 44
123 lines (106 loc) · 3.28 KB
/
cibuildwheel.yml
File metadata and controls
123 lines (106 loc) · 3.28 KB
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
117
118
119
120
121
122
123
name: Wheels
on:
pull_request:
branches:
- master
push:
tags:
- "v*"
jobs:
build_bdist:
name: "Build ${{ matrix.os }} (${{ matrix.arch }}) wheels"
runs-on: ${{ matrix.os }}
timeout-minutes: 60 # should be long enough even on tags, but let's prevent hangs
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
arch: x86_64
- os: ubuntu-22.04-arm
arch: aarch64
- os: windows-2022
arch: AMD64
- os: macos-14
arch: arm64
- os: macos-15-intel
arch: x86_64
- os: windows-11-arm
arch: ARM64
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
# For aarch64 support
# https://cibuildwheel.pypa.io/en/stable/faq/#emulation
#- uses: docker/setup-qemu-action@v3
# with:
# platforms: all
# if: runner.os == 'Linux' && matrix.arch == 'aarch64'
- name: Build just oldest and newest on PRs, all on tags
if: ${{ github.event_name }} == pull_request
shell: bash
# - On PPs, omit musllinux for speed
# - On PRs, run just oldest and newest Python versions (3.11 is the oldest abi3 target)
run: |
CIBW_SKIP="cp310-win_arm64 *musllinux*"
echo "CIBW_SKIP=$CIBW_SKIP" >> $GITHUB_ENV
echo "Setting CIBW_SKIP=$CIBW_SKIP"
CIBW_TEST_SKIP="cp312-* cp313-*"
echo "CIBW_TEST_SKIP=$CIBW_TEST_SKIP" >> $GITHUB_ENV
echo "Setting CIBW_TEST_SKIP=$CIBW_TEST_SKIP"
- name: "Building ${{ matrix.os }} (${{ matrix.arch }}) wheels"
uses: pypa/cibuildwheel@v3.4.0
env:
CIBW_SKIP: ${{ env.CIBW_SKIP }}
CIBW_TEST_SKIP: ${{ env.CIBW_TEST_SKIP }}
CIBW_ARCHS: ${{ matrix.arch }}
- uses: actions/upload-artifact@v7
with:
name: pypi-artifacts-${{ matrix.os }}-${{ matrix.arch }}
path: ${{ github.workspace }}/wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Build sdist
run: >
pip install build
&& python -m build --sdist . --outdir dist
- uses: actions/upload-artifact@v7
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist/*.tar.gz
show-artifacts:
needs: [build_bdist, build_sdist]
name: "Show artifacts"
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v8
with:
pattern: pypi-artifacts*
path: ${{ github.workspace }}/dist
merge-multiple: true
- shell: bash
run: |
ls -l ${{ github.workspace }}/dist
publish-artifacts-pypi:
needs: [build_bdist, build_sdist]
name: "Publish to PyPI"
runs-on: ubuntu-22.04
# upload to PyPI for every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v8
with:
pattern: pypi-artifacts*
path: ${{ github.workspace }}/dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
print_hash: true