-
Notifications
You must be signed in to change notification settings - Fork 10
103 lines (93 loc) · 2.93 KB
/
release-python.yml
File metadata and controls
103 lines (93 loc) · 2.93 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
name: Release — Python (PyPI)
on:
push:
tags: ['v[0-9]+.[0-9]+.[0-9]+']
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
build-wheels:
name: Build wheel — ${{ matrix.platform.target }}
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
manylinux: auto
interpreter: python3.10 python3.11 python3.12 python3.13
- runner: ubuntu-latest
target: aarch64-unknown-linux-gnu
manylinux: auto
interpreter: python3.10 python3.11 python3.12 python3.13
- runner: macos-latest
target: x86_64-apple-darwin
manylinux: ''
interpreter: python3.10 python3.11 python3.12 python3.13
- runner: macos-14
target: aarch64-apple-darwin
manylinux: ''
interpreter: python3.10 python3.11 python3.12 python3.13
- runner: windows-latest
target: x86_64-pc-windows-msvc
manylinux: ''
interpreter: python3.10 python3.11 python3.12 python3.13
steps:
- uses: actions/checkout@v4
# For non-manylinux (macOS, Windows) install multiple Python versions.
# For manylinux, actions/setup-python doesn't affect the containerised
# build — maturin finds Python inside the container via -i.
- uses: actions/setup-python@v5
if: ${{ matrix.platform.manylinux == '' }}
with:
python-version: |
3.10
3.11
3.12
3.13
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
manylinux: ${{ matrix.platform.manylinux }}
working-directory: sdks/python
args: >-
--release --out dist/
-i ${{ matrix.platform.interpreter }}
sccache: 'true'
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.platform.target }}
path: sdks/python/dist/
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: '3.12' }
- run: pip install maturin
- run: |
cd sdks/python
maturin sdist --out dist/
- uses: actions/upload-artifact@v4
with:
name: sdist
path: sdks/python/dist/
publish-pypi:
name: Publish to PyPI
needs: [build-wheels, build-sdist]
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/