-
-
Notifications
You must be signed in to change notification settings - Fork 358
83 lines (79 loc) · 3.02 KB
/
Copy pathpython-wheels.yml
File metadata and controls
83 lines (79 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Python wheels
# Build abi3 wheels for the four engine packages across every supported
# platform and (on a `python-v*` tag) publish them to PyPI via trusted
# publishing.
#
# abi3-py39 means ONE wheel per (package, platform, arch) covers Python 3.9+,
# so there is deliberately no Python-version axis.
#
# NOTE: no sdist is published. The rapier2d/3d engine crates share their
# source via the repo-root `src/` tree (`[lib] path = "../../src/lib.rs"`),
# which lives outside any vendored crate directory, and maturin's sdist
# packer cannot reach parent paths (`..` is rejected in `include`). A source
# build would therefore be incomplete. The wheel matrix below covers all
# mainstream platforms; source builds use a full git checkout of the repo.
# Restoring an sdist is tracked as a follow-up (needs an upstream layout
# change or registry-based engine deps).
on:
push:
branches: [master]
tags: ["python-v*"]
pull_request:
branches: [master]
paths:
- "python/**"
- ".github/workflows/python-wheels.yml"
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: wheel ${{ matrix.package.name }} ${{ matrix.platform.target }}
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
package:
- { dir: rapier-py-3d, name: rapier3d }
- { dir: rapier-py-3d-f64, name: rapier3d-f64 }
- { dir: rapier-py-2d, name: rapier2d }
- { dir: rapier-py-2d-f64, name: rapier2d-f64 }
platform:
- { runner: ubuntu-latest, target: x86_64-unknown-linux-gnu, manylinux: auto }
- { runner: ubuntu-latest, target: aarch64-unknown-linux-gnu, manylinux: auto }
- { runner: ubuntu-latest, target: x86_64-unknown-linux-musl, manylinux: musllinux_1_2 }
- { runner: ubuntu-latest, target: aarch64-unknown-linux-musl, manylinux: musllinux_1_2 }
- { runner: macos-14, target: aarch64-apple-darwin }
- { runner: windows-latest, target: x86_64-pc-windows-msvc }
steps:
- uses: actions/checkout@v4
- name: Build wheel
uses: PyO3/maturin-action@v1
with:
command: build
target: ${{ matrix.platform.target }}
manylinux: ${{ matrix.platform.manylinux }}
args: --release --out dist -m python/${{ matrix.package.dir }}/Cargo.toml
sccache: "true"
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.package.name }}-${{ matrix.platform.target }}
path: dist
publish:
name: Publish to PyPI
needs: [build]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/python-v')
environment: pypi
permissions:
id-token: write # OIDC for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: "wheels-*"
merge-multiple: true
- name: Publish all four packages
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist