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.
113name : Python builds
214
315on :
2234
2335jobs :
2436 linux :
25- runs-on : ubuntu-latest
37+ runs-on : ${{ matrix.platform.runner }}
2638 strategy :
27- fail-fast : false
2839 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
3653 steps :
3754 - uses : actions/checkout@v4
3855 - uses : actions/setup-python@v5
4360 shell : bash
4461 id : is-openssl-vendored
4562 run : |
46- if [[ "${{ startsWith(matrix.target, 'x86') }}" == "true" ]]; then
63+ if [[ "${{ startsWith(matrix.platform. target, 'x86') }}" == "true" ]]; then
4764 echo "enabled=" >> $GITHUB_OUTPUT
4865 else
4966 echo "enabled=--features openssl-vendored" >> $GITHUB_OUTPUT
@@ -52,11 +69,12 @@ jobs:
5269 - name : Build wheels
5370 uses : PyO3/maturin-action@v1
5471 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'
5775 manylinux : auto
5876 before-script-linux : |
59- case "${{ matrix.target }}" in
77+ case "${{ matrix.platform. target }}" in
6078 "aarch64" | "armv7" | "s390x" | "ppc64le")
6179 # NOTE: pypa/manylinux docker images are Debian based
6280 sudo apt-get update
@@ -71,38 +89,46 @@ jobs:
7189 - name : Upload wheels
7290 uses : actions/upload-artifact@v4
7391 with :
74- name : wheels-linux-${{ matrix.target }}
92+ name : wheels-linux-${{ matrix.platform. target }}
7593 path : dist/*
7694
7795 windows :
78- runs-on : windows-latest
96+ runs-on : ${{ matrix.platform.runner }}
7997 strategy :
80- fail-fast : false
8198 matrix :
82- target : [x64, x86]
99+ platform :
100+ - runner : windows-latest
101+ target : x64
102+ - runner : windows-latest
103+ target : x86
83104 steps :
84105 - uses : actions/checkout@v4
85106 - uses : actions/setup-python@v5
86107 with :
87108 python-version : ' 3.x'
88- architecture : ${{ matrix.target }}
109+ architecture : ${{ matrix.platform. target }}
89110 - name : Build wheels
90111 uses : PyO3/maturin-action@v1
91112 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'
94116 - name : Upload wheels
95117 uses : actions/upload-artifact@v4
96118 with :
97- name : wheels-windows-${{ matrix.target }}
119+ name : wheels-windows-${{ matrix.platform. target }}
98120 path : dist/*
99121
100122 macos :
101- runs-on : macos-latest
123+ runs-on : ${{ matrix.platform.runner }}
102124 strategy :
103125 fail-fast : false
104126 matrix :
105- target : [x86_64, aarch64]
127+ platform :
128+ - runner : macos-12
129+ target : x86_64
130+ - runner : macos-14
131+ target : aarch64
106132 steps :
107133 - uses : actions/checkout@v4
108134 - uses : actions/setup-python@v5
@@ -111,12 +137,13 @@ jobs:
111137 - name : Build wheels
112138 uses : PyO3/maturin-action@v1
113139 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'
116143 - name : Upload wheels
117144 uses : actions/upload-artifact@v4
118145 with :
119- name : wheels-macos-${{ matrix.target }}
146+ name : wheels-macos-${{ matrix.platform. target }}
120147 path : dist/*
121148
122149 sdist :
@@ -139,18 +166,17 @@ jobs:
139166 runs-on : ubuntu-latest
140167 if : startsWith(github.ref, 'refs/tags/')
141168 needs : [linux, windows, macos, sdist]
169+ permissions :
170+ id-token : write
142171 steps :
143172 - uses : actions/download-artifact@v4
144- with :
145- path : dist
146- - run : mv dist/**/*.{whl,gz} dist/
147173 - name : Publish to PyPI
148174 uses : PyO3/maturin-action@v1
149175 env :
150176 # This workflow is registered as a trusted publisher (for test-pypi and pypi).
151177 # A token should not be required (and actually is discouraged with trusted publishers).
152178 # 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 ' }}
154180 with :
155181 command : upload
156- args : --non-interactive --skip-existing dist /*
182+ args : --non-interactive --skip-existing wheels-* /*
0 commit comments