1
+ # This file was mostly autogenerated by maturin v1.7.1
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci github --manifest-path py-binding/Cargo.toml
5
+ #
6
+ # NOTE: There are some customizations added to the generated output.
7
+ # - workflow name is more descriptive
8
+ # - use openssl-vendored cargo feature on
9
+ # * most cross-compiled Linux wheels
10
+ # * all MacOS builds
11
+ # - muslinux builds (& x390 Linux target) are excluded due to complexity of
12
+ # installing openSSL lib in cross-compiler's docker/env.
1
13
name : Python builds
2
14
3
15
on :
22
34
23
35
jobs :
24
36
linux :
25
- runs-on : ubuntu-latest
37
+ runs-on : ${{ matrix.platform.runner }}
26
38
strategy :
27
- fail-fast : false
28
39
matrix :
29
- target :
30
- - x86_64
31
- - x86
32
- - aarch64
33
- - armv7
34
- # - s390x
35
- - ppc64le
40
+ platform :
41
+ - runner : ubuntu-latest
42
+ target : x86_64
43
+ - runner : ubuntu-latest
44
+ target : x86
45
+ - runner : ubuntu-latest
46
+ target : aarch64
47
+ - runner : ubuntu-latest
48
+ target : armv7
49
+ # - runner: ubuntu-latest
50
+ # target: s390x
51
+ - runner : ubuntu-latest
52
+ target : ppc64le
36
53
steps :
37
54
- uses : actions/checkout@v4
38
55
- uses : actions/setup-python@v5
43
60
shell : bash
44
61
id : is-openssl-vendored
45
62
run : |
46
- if [[ "${{ startsWith(matrix.target, 'x86') }}" == "true" ]]; then
63
+ if [[ "${{ startsWith(matrix.platform. target, 'x86') }}" == "true" ]]; then
47
64
echo "enabled=" >> $GITHUB_OUTPUT
48
65
else
49
66
echo "enabled=--features openssl-vendored" >> $GITHUB_OUTPUT
@@ -52,11 +69,12 @@ jobs:
52
69
- name : Build wheels
53
70
uses : PyO3/maturin-action@v1
54
71
with :
55
- target : ${{ matrix.target }}
56
- args : --manifest-path py-binding/Cargo.toml --release --out dist --find-interpreter ${{ steps.is-openssl-vendored.outputs.enabled }}
72
+ target : ${{ matrix.platform.target }}
73
+ args : --release --out dist --find-interpreter --manifest-path py-binding/Cargo.toml ${{ steps.is-openssl-vendored.outputs.enabled }}
74
+ sccache : ' true'
57
75
manylinux : auto
58
76
before-script-linux : |
59
- case "${{ matrix.target }}" in
77
+ case "${{ matrix.platform. target }}" in
60
78
"aarch64" | "armv7" | "s390x" | "ppc64le")
61
79
# NOTE: pypa/manylinux docker images are Debian based
62
80
sudo apt-get update
@@ -71,38 +89,46 @@ jobs:
71
89
- name : Upload wheels
72
90
uses : actions/upload-artifact@v4
73
91
with :
74
- name : wheels-linux-${{ matrix.target }}
92
+ name : wheels-linux-${{ matrix.platform. target }}
75
93
path : dist/*
76
94
77
95
windows :
78
- runs-on : windows-latest
96
+ runs-on : ${{ matrix.platform.runner }}
79
97
strategy :
80
- fail-fast : false
81
98
matrix :
82
- target : [x64, x86]
99
+ platform :
100
+ - runner : windows-latest
101
+ target : x64
102
+ - runner : windows-latest
103
+ target : x86
83
104
steps :
84
105
- uses : actions/checkout@v4
85
106
- uses : actions/setup-python@v5
86
107
with :
87
108
python-version : ' 3.x'
88
- architecture : ${{ matrix.target }}
109
+ architecture : ${{ matrix.platform. target }}
89
110
- name : Build wheels
90
111
uses : PyO3/maturin-action@v1
91
112
with :
92
- target : ${{ matrix.target }}
93
- args : --manifest-path py-binding/Cargo.toml --release --out dist --find-interpreter
113
+ target : ${{ matrix.platform.target }}
114
+ args : --release --out dist --find-interpreter --manifest-path py-binding/Cargo.toml
115
+ sccache : ' true'
94
116
- name : Upload wheels
95
117
uses : actions/upload-artifact@v4
96
118
with :
97
- name : wheels-windows-${{ matrix.target }}
119
+ name : wheels-windows-${{ matrix.platform. target }}
98
120
path : dist/*
99
121
100
122
macos :
101
- runs-on : macos-latest
123
+ runs-on : ${{ matrix.platform.runner }}
102
124
strategy :
103
125
fail-fast : false
104
126
matrix :
105
- target : [x86_64, aarch64]
127
+ platform :
128
+ - runner : macos-12
129
+ target : x86_64
130
+ - runner : macos-14
131
+ target : aarch64
106
132
steps :
107
133
- uses : actions/checkout@v4
108
134
- uses : actions/setup-python@v5
@@ -111,12 +137,13 @@ jobs:
111
137
- name : Build wheels
112
138
uses : PyO3/maturin-action@v1
113
139
with :
114
- target : ${{ matrix.target }}
115
- args : --manifest-path py-binding/Cargo.toml --release --out dist --find-interpreter --features openssl-vendored
140
+ target : ${{ matrix.platform.target }}
141
+ args : --release --out dist --find-interpreter --manifest-path py-binding/Cargo.toml --features openssl-vendored
142
+ sccache : ' true'
116
143
- name : Upload wheels
117
144
uses : actions/upload-artifact@v4
118
145
with :
119
- name : wheels-macos-${{ matrix.target }}
146
+ name : wheels-macos-${{ matrix.platform. target }}
120
147
path : dist/*
121
148
122
149
sdist :
@@ -139,18 +166,17 @@ jobs:
139
166
runs-on : ubuntu-latest
140
167
if : startsWith(github.ref, 'refs/tags/')
141
168
needs : [linux, windows, macos, sdist]
169
+ permissions :
170
+ id-token : write
142
171
steps :
143
172
- uses : actions/download-artifact@v4
144
- with :
145
- path : dist
146
- - run : mv dist/**/*.{whl,gz} dist/
147
173
- name : Publish to PyPI
148
174
uses : PyO3/maturin-action@v1
149
175
env :
150
176
# This workflow is registered as a trusted publisher (for test-pypi and pypi).
151
177
# A token should not be required (and actually is discouraged with trusted publishers).
152
178
# MATURIN_PYPI_TOKEN: ${{ contains(github.ref_name, 'rc') && secrets.TEST_PYPI_API_TOKEN || secrets.PYPI_API_TOKEN }}
153
- MATURIN_REPOSITORY : ${{ contains(github.ref_name, 'rc') && 'test- pypi' || 'pypi' }}
179
+ MATURIN_REPOSITORY_URL : ${{ contains(github.ref_name, 'rc') && 'https:// test. pypi.org/legacy ' || 'https://upload. pypi.org/legacy ' }}
154
180
with :
155
181
command : upload
156
- args : --non-interactive --skip-existing dist /*
182
+ args : --non-interactive --skip-existing wheels-* /*
0 commit comments