-
-
Notifications
You must be signed in to change notification settings - Fork 88
112 lines (106 loc) · 3.08 KB
/
pypi.yml
File metadata and controls
112 lines (106 loc) · 3.08 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: PyPI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Build
uses: PyO3/maturin-action@v1
with:
target: universal2-apple-darwin
args: --release --out dist --strip
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels-macos-universal2
path: dist
windows:
runs-on: windows-latest
strategy:
matrix:
platform:
- arch: x64
target: x86_64-pc-windows-msvc
- arch: x86
target: i686-pc-windows-msvc
- arch: arm64
target: aarch64-pc-windows-msvc
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: dtolnay/rust-toolchain@stable
- name: Build
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --strip
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.platform.arch }}
path: dist
linux:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
[
{ target: 'x86_64-unknown-linux-musl', image_tag: 'x86_64-musl' },
{ target: 'i686-unknown-linux-musl', image_tag: 'i686-musl' },
{ target: 'aarch64-unknown-linux-musl', image_tag: 'aarch64-musl' },
{
target: 'armv7-unknown-linux-musleabihf',
image_tag: 'armv7-musleabihf',
},
{
target: 'armv7-unknown-linux-musleabi',
image_tag: 'armv7-musleabi',
},
]
container:
image: docker://ghcr.io/rust-cross/rust-musl-cross:${{ matrix.platform.image_tag }}
env:
CFLAGS_armv7_unknown_linux_musleabihf: '-mfpu=vfpv3-d16'
steps:
- uses: actions/checkout@v6
- name: Build
uses: PyO3/maturin-action@main
with:
target: ${{ matrix.platform.target }}
manylinux: auto
container: off
args: --release -o dist --strip
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.platform.target }}
path: dist
release:
name: Release PyPI
runs-on: ubuntu-slim
if: "startsWith(github.ref, 'refs/tags/')"
needs: [macos, windows, linux]
environment:
name: PyPI
url: https://pypi.org/project/cargo-zigbuild/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
pattern: wheels-*
merge-multiple: true
- uses: astral-sh/setup-uv@v7
- name: Publish to PyPI
run: uv publish --trusted-publishing always *.whl