Skip to content

Commit e1785ed

Browse files
fsecada01claude
andcommitted
Fix PyPI release workflow for Maturin/Rust extension
python -m build produces a bare linux_x86_64 wheel which PyPI rejects (400 Bad Request) — platform wheels must be manylinux-tagged. Replace with the standard PyO3/maturin-action matrix that builds: - Linux x86_64 + aarch64 (manylinux auto) - Windows x64 - macOS x86_64 + aarch64 - Source distribution All artifacts are collected and published in a single upload job. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 91629b2 commit e1785ed

1 file changed

Lines changed: 70 additions & 17 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,76 @@ permissions:
88
contents: read
99

1010
jobs:
11-
deploy:
11+
linux:
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
target: [x86_64, aarch64]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: PyO3/maturin-action@v1
19+
with:
20+
target: ${{ matrix.target }}
21+
args: --release --out dist
22+
manylinux: auto
23+
- uses: actions/upload-artifact@v4
24+
with:
25+
name: wheels-linux-${{ matrix.target }}
26+
path: dist
27+
28+
windows:
29+
runs-on: windows-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: PyO3/maturin-action@v1
33+
with:
34+
target: x64
35+
args: --release --out dist
36+
- uses: actions/upload-artifact@v4
37+
with:
38+
name: wheels-windows-x64
39+
path: dist
40+
41+
macos:
42+
runs-on: macos-latest
43+
strategy:
44+
matrix:
45+
target: [x86_64, aarch64]
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: PyO3/maturin-action@v1
49+
with:
50+
target: ${{ matrix.target }}
51+
args: --release --out dist
52+
- uses: actions/upload-artifact@v4
53+
with:
54+
name: wheels-macos-${{ matrix.target }}
55+
path: dist
1356

57+
sdist:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: PyO3/maturin-action@v1
62+
with:
63+
command: sdist
64+
args: --out dist
65+
- uses: actions/upload-artifact@v4
66+
with:
67+
name: wheels-sdist
68+
path: dist
69+
70+
publish:
71+
name: Publish to PyPI
72+
runs-on: ubuntu-latest
73+
needs: [linux, windows, macos, sdist]
1474
steps:
15-
- uses: actions/checkout@v4
16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: '3.12'
20-
- name: Install uv
21-
uses: astral-sh/setup-uv@v5
22-
- name: Install build dependencies
23-
run: uv pip install --system build twine
24-
- name: Build package
25-
run: python -m build
26-
- name: Publish package
27-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
28-
with:
29-
user: __token__
30-
password: ${{ secrets.PYPI_API_TOKEN }}
75+
- uses: actions/download-artifact@v4
76+
with:
77+
pattern: wheels-*
78+
path: dist
79+
merge-multiple: true
80+
- uses: pypa/gh-action-pypi-publish@release/v1
81+
with:
82+
user: __token__
83+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)