@@ -46,21 +46,30 @@ jobs:
4646 - name : linux-x86_64
4747 os : ubuntu-latest
4848 build-sdist : true
49- publish-args : --release --sdist --interpreter python3.12 python3.13
49+ publish-args : --release --sdist --interpreter python3.12 python3.13 --out dist
5050 manylinux : 2014
51+ target : " "
5152 - name : linux-aarch64
5253 os : ubuntu-latest
5354 build-sdist : false
54- publish-args : --release --interpreter python3.12 python3.13 --target aarch64-unknown-linux-gnu
55+ publish-args : --release --interpreter python3.12 python3.13 --target aarch64-unknown-linux-gnu --out dist
5556 manylinux : 2014
56- - name : macos-universal2
57+ target : " "
58+ - name : macos-x86_64
5759 os : macos-13
5860 build-sdist : false
59- publish-args : --release --universal2
61+ publish-args : --release --out dist --interpreter python3.12 python3.13
62+ target : x86_64
63+ - name : macos-aarch64
64+ os : macos-14
65+ build-sdist : false
66+ publish-args : --release --out dist --interpreter python3.12 python3.13
67+ target : aarch64
6068 - name : windows-amd64
6169 os : windows-latest
6270 build-sdist : false
63- publish-args : --release
71+ publish-args : --release --out dist
72+ target : " "
6473 steps :
6574 - uses : actions/checkout@v4
6675 - name : Check recorder version parity
@@ -113,6 +122,7 @@ jobs:
113122 command : build
114123 args : ${{ matrix.publish-args }}
115124 manylinux : ${{ matrix.manylinux }}
125+ sccache : true
116126 before-script-linux : |
117127 set -eux
118128 if command -v yum >/dev/null 2>&1; then
@@ -131,15 +141,13 @@ jobs:
131141 working-directory : codetracer-python-recorder
132142
133143 - name : Install Python 3.12 (macOS)
134- if : startsWith(matrix.name, 'macos')
135- id : mac_py312
144+ if : startsWith(matrix.name, 'macos-')
136145 uses : actions/setup-python@v5
137146 with :
138147 python-version : ' 3.12'
139148
140149 - name : Install Python 3.13 (macOS)
141- if : startsWith(matrix.name, 'macos')
142- id : mac_py313
150+ if : startsWith(matrix.name, 'macos-')
143151 uses : actions/setup-python@v5
144152 with :
145153 python-version : ' 3.13'
@@ -161,56 +169,49 @@ jobs:
161169 architecture : ' x64'
162170
163171 - name : Install Cap'n Proto (macOS)
164- if : startsWith(matrix.name, 'macos')
172+ if : startsWith(matrix.name, 'macos- ')
165173 run : brew install capnp
166174
167175 - name : Install Cap'n Proto (Windows)
168176 if : matrix.name == 'windows-amd64'
169177 run : choco install -y capnproto
170178
171- - name : Install maturin (macOS)
172- if : startsWith(matrix.name, 'macos')
173- shell : bash
174- run : |
175- PYTHON=$(python3 -c "import sys; print(sys.executable)")
176- "$PYTHON" -m pip install --upgrade pip
177- "$PYTHON" -m pip install "maturin>=1.5,<2"
178-
179179 - name : Install maturin (Windows)
180180 if : matrix.name == 'windows-amd64'
181181 shell : pwsh
182182 run : |
183183 & "$env:PYTHON" -m pip install --upgrade pip
184184 & "$env:PYTHON" -m pip install "maturin>=1.5,<2"
185185
186- - name : Build artefacts (macOS universal2)
187- if : startsWith(matrix.name, 'macos')
188- env :
189- PYTHON312 : ${{ steps.mac_py312.outputs.python-path }}
190- PYTHON313 : ${{ steps.mac_py313.outputs.python-path }}
191- working-directory : ${{ env.CRATE_DIR }}
192- run : maturin build ${{ matrix.publish-args }} --interpreter "$PYTHON312" "$PYTHON313"
186+ - name : Build artefacts (macOS targets)
187+ if : startsWith(matrix.name, 'macos-')
188+ uses : PyO3/maturin-action@v1
189+ with :
190+ command : build
191+ args : ${{ matrix.publish-args }}
192+ target : ${{ matrix.target }}
193+ working-directory : ${{ env.CRATE_DIR }}
193194
194195 - name : Build cp312 wheel (Windows)
195196 if : matrix.name == 'windows-amd64'
196197 env :
197198 PYTHON : ${{ steps.win_py312.outputs.python-path }}
198199 working-directory : ${{ env.CRATE_DIR }}
199- run : maturin build --release --interpreter "$env:PYTHON\python.exe"
200+ run : maturin build --release --out dist -- interpreter "$env:PYTHON\python.exe"
200201
201202 - name : Build cp313 wheel (Windows)
202203 if : matrix.name == 'windows-amd64'
203204 env :
204205 PYTHON : ${{ steps.win_py313.outputs.python-path }}
205206 working-directory : ${{ env.CRATE_DIR }}
206- run : maturin build --release --interpreter "$env:PYTHON\python.exe"
207+ run : maturin build --release --out dist -- interpreter "$env:PYTHON\python.exe"
207208
208209 - name : Upload artefacts
209210 uses : actions/upload-artifact@v4
210211 with :
211212 name : dist-${{ matrix.name }}
212213 path : |
213- codetracer-python-recorder/target/wheels /*
214+ codetracer-python-recorder/dist /*
214215 if-no-files-found : error
215216
216217 publish-testpypi :
@@ -257,6 +258,10 @@ jobs:
257258 environment :
258259 name : pypi-production
259260 url : https://pypi.org/project/codetracer-python-recorder/
261+ permissions :
262+ contents : read
263+ id-token : write
264+ attestations : write
260265 steps :
261266 - uses : actions/checkout@v4
262267 - uses : actions/setup-python@v5
@@ -268,6 +273,10 @@ jobs:
268273 pattern : dist-*
269274 path : dist
270275 merge-multiple : true
276+ - name : Generate artifact attestation
277+ uses : actions/attest-build-provenance@v2
278+ with :
279+ subject-path : ' dist/*'
271280 - name : Publish to PyPI
272281 uses : pypa/gh-action-pypi-publish@release/v1
273282 with :
0 commit comments