-
Notifications
You must be signed in to change notification settings - Fork 3
112 lines (98 loc) · 3.13 KB
/
Copy pathdeploy.yml
File metadata and controls
112 lines (98 loc) · 3.13 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
name: Build wheels
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
tags: [v*]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} ${{ matrix.macos_arch }} ${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: macos-15-intel
macos_arch: "x86_64"
- os: macos-latest
macos_arch: "arm64"
# Parallelize Windows by Python version (slow serial builds)
- os: windows-latest
python: cp39
- os: windows-latest
python: cp310
- os: windows-latest
python: cp311
- os: windows-latest
python: cp312
- os: windows-latest
python: cp313
- os: windows-latest
python: cp314
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: TheMrMilchmann/setup-msvc-dev@v4
if: runner.os == 'Windows'
with:
arch: x64
- uses: astral-sh/setup-uv@v7
- run: uv run scripts/extract_version.py --update
- name: Build wheels
uses: pypa/cibuildwheel@v4.1
env:
CIBW_BUILD: ${{ matrix.python && format('{0}-*', matrix.python) }}
CIBW_ARCHS_MACOS: "${{ matrix.macos_arch }}"
# Python on Linux is usually configured to add debug information,
# which increases binary size by ~11-fold. Remove for the builds we
# distribute.
CIBW_ENVIRONMENT_LINUX: "LDFLAGS=-Wl,--strip-debug"
- name: check-wheel-contents
run: uvx check-wheel-contents ./wheelhouse
- uses: actions/upload-artifact@v7
with:
name: artifact-wheels-${{ matrix.os }}${{ matrix.macos_arch && format('-{0}', matrix.macos_arch) }}${{ matrix.python && format('-{0}', matrix.python) }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v7
- name: Build sdist
run: |
uv run scripts/extract_version.py --update
uv build --sdist
- uses: actions/upload-artifact@v7
with:
name: artifact-sdist
path: dist/*.tar.gz
publish:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# publish on every tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# https://docs.pypi.org/trusted-publishers/
permissions:
id-token: write # for trusted publishing on PyPi
contents: write # allows writing releases
steps:
- uses: actions/download-artifact@v8
with:
pattern: artifact-*
merge-multiple: true
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
files: "./dist/*"