Skip to content

Commit ef17551

Browse files
authored
Merge pull request #375 from NNPDF/update-wheels-actions
Update wheels actions
2 parents 4df940e + d1bd045 commit ef17551

13 files changed

Lines changed: 183 additions & 152 deletions

File tree

.github/workflows/capi.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches-ignore:
66
- pycli
77
- bump-pyo3-version
8+
- update-wheels-actions
89

910
defaults:
1011
run:

.github/workflows/msrv.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches-ignore:
66
- pycli
77
- bump-pyo3-version
8+
- update-wheels-actions
89

910
env:
1011
CARGO_TERM_COLOR: always

.github/workflows/python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches-ignore:
66
- pycli
7+
- update-wheels-actions
78

89
jobs:
910
test:
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: Release Python wheels
2+
3+
# for available runner images see: https://github.com/actions/runner-images
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v[0-9]+*'
9+
workflow_dispatch:
10+
11+
jobs:
12+
wheels-linux:
13+
runs-on: ${{ matrix.platform.runner }}
14+
strategy:
15+
matrix:
16+
platform:
17+
- runner: ubuntu-22.04
18+
target: x86_64
19+
manylinux: 2_17
20+
#- runner: ubuntu-22.04
21+
# target: x86
22+
#- runner: ubuntu-22.04
23+
# target: aarch64
24+
#- runner: ubuntu-22.04
25+
# target: armv7
26+
#- runner: ubuntu-22.04
27+
# target: s390x
28+
#- runner: ubuntu-22.04
29+
# target: ppc64le
30+
steps:
31+
- uses: actions/checkout@v6
32+
- uses: actions/setup-python@v6
33+
with:
34+
python-version: 3.x
35+
- name: Build wheels
36+
uses: PyO3/maturin-action@v1
37+
with:
38+
target: ${{ matrix.platform.target }}
39+
args: --release --out dist --interpreter python3.8 python3.9 python3.10 python3.11 python3.12 python3.13 python3.14 pypy3.9 pypy3.10 pypy3.11 --manifest-path pineappl_py/Cargo.toml
40+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
41+
manylinux: ${{ matrix.platform.manylinux }}
42+
- name: Upload wheels
43+
uses: actions/upload-artifact@v5
44+
with:
45+
name: ${{ github.job }}-${{ matrix.platform.target }}
46+
path: dist
47+
48+
wheels-macos:
49+
runs-on: ${{ matrix.platform.runner }}
50+
strategy:
51+
matrix:
52+
platform:
53+
- runner: macos-15-intel
54+
target: x86_64
55+
- runner: macos-latest
56+
target: aarch64
57+
steps:
58+
- uses: actions/checkout@v6
59+
- uses: actions/setup-python@v6
60+
with:
61+
python-version: 3.x
62+
- name: Build wheels
63+
uses: PyO3/maturin-action@v1
64+
with:
65+
target: ${{ matrix.platform.target }}
66+
args: --release --out dist --interpreter python3.7 python3.8 python3.9 python3.10 python3.11 python3.12 python3.13 python3.14 pypy3.9 pypy3.10 --manifest-path pineappl_py/Cargo.toml
67+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
68+
- name: Upload wheels
69+
uses: actions/upload-artifact@v5
70+
with:
71+
name: ${{ github.job }}-${{ matrix.platform.target }}
72+
path: dist
73+
74+
wheels-sdist:
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v6
78+
- name: Build sdist
79+
uses: PyO3/maturin-action@v1
80+
with:
81+
command: sdist
82+
args: --out dist --manifest-path pineappl_py/Cargo.toml
83+
- name: Upload sdist
84+
uses: actions/upload-artifact@v5
85+
with:
86+
name: ${{ github.job }}
87+
path: dist
88+
89+
wheels-windows:
90+
runs-on: ${{ matrix.platform.runner }}
91+
strategy:
92+
matrix:
93+
platform:
94+
- runner: windows-2025
95+
target: x64
96+
python_arch: x64
97+
# - runner: windows-latest
98+
# target: x86
99+
# python_arch: x86
100+
# - runner: windows-11-arm
101+
# target: aarch64
102+
# python_arch: arm64
103+
steps:
104+
- uses: actions/checkout@v6
105+
- uses: actions/setup-python@v6
106+
with:
107+
python-version: 3.13
108+
architecture: ${{ matrix.platform.python_arch }}
109+
- name: Build wheels
110+
uses: PyO3/maturin-action@v1
111+
with:
112+
target: ${{ matrix.platform.target }}
113+
# Python 3.7, 3.8, 3.9, PyPy 3.9 and 3.10 don't seem to work on Windows and fail with
114+
# Interpreters ["CPython 3.7", "PyPy 3.9", "PyPy 3.10"] were found in maturin's bundled sysconfig, but compiling for Windows without an interpreter requires PyO3's `generate-import-lib` feature
115+
# even though the interpreters were installed
116+
args: --release --out dist --interpreter python3.10 python3.11 python3.12 python3.13 python3.14 --manifest-path pineappl_py/Cargo.toml
117+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
118+
- name: Upload wheels
119+
uses: actions/upload-artifact@v5
120+
with:
121+
name: ${{ github.job }}-${{ matrix.platform.target }}
122+
path: dist
123+
124+
release-wheels:
125+
name: Publish wheels
126+
runs-on: ubuntu-latest
127+
if: "startsWith(github.ref, 'refs/tags/')"
128+
needs:
129+
- wheels-linux
130+
- wheels-macos
131+
- wheels-sdist
132+
- wheels-windows
133+
permissions:
134+
# Use to sign the release artifacts
135+
id-token: write
136+
# Used to upload release artifacts
137+
contents: write
138+
# Used to generate artifact attestation
139+
attestations: write
140+
steps:
141+
- uses: actions/download-artifact@v6
142+
- name: Generate artifact attestation
143+
uses: actions/attest-build-provenance@v3
144+
with:
145+
subject-path: 'wheels-*/*'
146+
- name: Install uv
147+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
148+
uses: astral-sh/setup-uv@v7
149+
- name: Publish to PyPI
150+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
151+
run: uv publish 'wheels-*/*'
152+
env:
153+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}

.github/workflows/release.yml

Lines changed: 3 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ name: Release
44

55
on:
66
push:
7+
branches-ignore:
8+
- update-wheels-actions
79
tags:
810
- 'v[0-9]+*'
911
workflow_dispatch:
1012

1113
env:
12-
# this is make the `gh` binary work
14+
# make the `gh` binary work
1315
GH_TOKEN: ${{ github.token }}
1416

1517
jobs:
@@ -338,117 +340,6 @@ jobs:
338340
cd ../pineappl_cli
339341
cargo publish
340342
341-
wheels-linux:
342-
runs-on: ubuntu-latest
343-
strategy:
344-
matrix:
345-
target: [x86_64]
346-
steps:
347-
- uses: actions/checkout@v4
348-
# for Linux the wheels are built in a container, so we don't need the `setup-python` action
349-
- name: Build wheels
350-
uses: PyO3/maturin-action@v1
351-
with:
352-
target: ${{ matrix.target }}
353-
# `--find-interpreter` is needed to generate wheels for *all* Python versions
354-
args: --release --out dist --find-interpreter --manifest-path pineappl_py/Cargo.toml
355-
sccache: 'true'
356-
manylinux: auto
357-
- name: Upload wheels
358-
uses: actions/upload-artifact@v4
359-
with:
360-
name: ${{ github.job }}-${{ matrix.target }}
361-
path: dist
362-
363-
wheels-macos:
364-
runs-on: ${{ matrix.os }}
365-
strategy:
366-
matrix:
367-
include:
368-
- os: macos-15-intel
369-
target: x86_64
370-
- os: macos-15
371-
target: aarch64
372-
steps:
373-
- uses: actions/checkout@v4
374-
- uses: actions/setup-python@v5
375-
with:
376-
# WARNING: be careful with the ordering - the last version is the default one. Apparently
377-
# maturin doesn't find all Python versions when one chooses a PyPy version instead of
378-
# CPython as default
379-
python-version: |
380-
pypy3.8
381-
pypy3.9
382-
pypy3.10
383-
3.8
384-
3.9
385-
3.11
386-
3.12
387-
3.13
388-
3.10
389-
- name: Build wheels
390-
uses: PyO3/maturin-action@v1
391-
with:
392-
target: ${{ matrix.target }}
393-
args: --release --out dist --find-interpreter --manifest-path pineappl_py/Cargo.toml
394-
sccache: 'true'
395-
- name: Upload wheels
396-
uses: actions/upload-artifact@v4
397-
with:
398-
name: ${{ github.job }}-${{ matrix.target }}
399-
path: dist
400-
401-
wheels-sdist:
402-
runs-on: ubuntu-latest
403-
steps:
404-
- uses: actions/checkout@v4
405-
- name: Build sdist
406-
uses: PyO3/maturin-action@v1
407-
with:
408-
command: sdist
409-
args: --out dist --manifest-path pineappl_py/Cargo.toml
410-
- name: Upload sdist
411-
uses: actions/upload-artifact@v4
412-
with:
413-
name: ${{ github.job }}
414-
path: dist
415-
416-
wheels-windows:
417-
runs-on: windows-latest
418-
strategy:
419-
matrix:
420-
target: [x64]
421-
steps:
422-
- uses: actions/checkout@v4
423-
- uses: actions/setup-python@v5
424-
with:
425-
# WARNING: be careful with the ordering - the last version is the default one. Apparently
426-
# maturin doesn't find all Python versions when one chooses a PyPy version instead of
427-
# CPython as default
428-
python-version: |
429-
pypy3.8
430-
pypy3.9
431-
pypy3.10
432-
3.7
433-
3.8
434-
3.9
435-
3.11
436-
3.12
437-
3.13
438-
3.10
439-
architecture: ${{ matrix.target }}
440-
- name: Build wheels
441-
uses: PyO3/maturin-action@v1
442-
with:
443-
target: ${{ matrix.target }}
444-
args: --release --out dist --find-interpreter --manifest-path pineappl_py/Cargo.toml
445-
sccache: 'true'
446-
- name: Upload wheels
447-
uses: actions/upload-artifact@v4
448-
with:
449-
name: ${{ github.job }}-${{ matrix.target }}
450-
path: dist
451-
452343
release-cli-wheels:
453344
runs-on: ubuntu-latest
454345
if: "startsWith(github.ref, 'refs/tags/')"
@@ -467,24 +358,3 @@ jobs:
467358
with:
468359
command: upload
469360
args: --skip-existing *
470-
471-
release-wheels:
472-
runs-on: ubuntu-latest
473-
if: "startsWith(github.ref, 'refs/tags/')"
474-
needs:
475-
- wheels-linux
476-
- wheels-macos
477-
- wheels-sdist
478-
- wheels-windows
479-
steps:
480-
- uses: actions/download-artifact@v4
481-
with:
482-
pattern: "wheels-*"
483-
merge-multiple: true
484-
- name: Publish to PyPI
485-
uses: PyO3/maturin-action@v1
486-
env:
487-
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
488-
with:
489-
command: upload
490-
args: --skip-existing *

.github/workflows/rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches-ignore:
66
- pycli
77
- bump-pyo3-version
8+
- update-wheels-actions
89

910
defaults:
1011
run:

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## Added
11+
12+
- added support for the Python 3.14 on macOS (ARM64/x86)
13+
1014
## Removed
1115

12-
- removed support for Python 3.7 for macOS (ARM64) due to removed runner on
13-
Github
16+
- removed support for the following Python versions due to unresolved issue in
17+
maturin action on Windows (x86): Python 3.7, 3.8, 3.9
1418

1519
## [1.3.2] - 21/02/2026
1620

0 commit comments

Comments
 (0)