Skip to content

Commit 8e544fe

Browse files
authored
Added support for building via maturin (#14)
* Added support for building via maturin Signed-off-by: Esteve Fernandez <[email protected]> * Added environment information for PyPI trusted publishing Signed-off-by: Esteve Fernandez <[email protected]> --------- Signed-off-by: Esteve Fernandez <[email protected]>
1 parent fd04e02 commit 8e544fe

File tree

2 files changed

+156
-0
lines changed

2 files changed

+156
-0
lines changed
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# This file is autogenerated by maturin v1.7.1
2+
# To update, run
3+
#
4+
# maturin generate-ci github
5+
#
6+
name: 'Build binaries'
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- master
13+
tags:
14+
- '*'
15+
pull_request:
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
id-token: write
21+
22+
jobs:
23+
linux:
24+
runs-on: ${{ matrix.platform.runner }}
25+
strategy:
26+
matrix:
27+
platform:
28+
- runner: ubuntu-latest
29+
target: x86_64
30+
- runner: ubuntu-latest
31+
target: x86
32+
- runner: ubuntu-latest
33+
target: aarch64
34+
- runner: ubuntu-latest
35+
target: armv7
36+
- runner: ubuntu-latest
37+
target: s390x
38+
- runner: ubuntu-latest
39+
target: ppc64le
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: Build wheels
43+
uses: PyO3/maturin-action@v1
44+
with:
45+
target: ${{ matrix.platform.target }}
46+
args: --release --out dist
47+
sccache: 'true'
48+
manylinux: auto
49+
- name: Upload wheels
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: wheels-linux-${{ matrix.platform.target }}
53+
path: dist
54+
55+
musllinux:
56+
runs-on: ${{ matrix.platform.runner }}
57+
strategy:
58+
matrix:
59+
platform:
60+
- runner: ubuntu-latest
61+
target: x86_64
62+
- runner: ubuntu-latest
63+
target: x86
64+
- runner: ubuntu-latest
65+
target: aarch64
66+
- runner: ubuntu-latest
67+
target: armv7
68+
steps:
69+
- uses: actions/checkout@v4
70+
- name: Build wheels
71+
uses: PyO3/maturin-action@v1
72+
with:
73+
target: ${{ matrix.platform.target }}
74+
args: --release --out dist
75+
sccache: 'true'
76+
manylinux: musllinux_1_2
77+
- name: Upload wheels
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: wheels-musllinux-${{ matrix.platform.target }}
81+
path: dist
82+
83+
windows:
84+
runs-on: ${{ matrix.platform.runner }}
85+
strategy:
86+
matrix:
87+
platform:
88+
- runner: windows-latest
89+
target: x64
90+
- runner: windows-latest
91+
target: x86
92+
steps:
93+
- uses: actions/checkout@v4
94+
- name: Build wheels
95+
uses: PyO3/maturin-action@v1
96+
with:
97+
target: ${{ matrix.platform.target }}
98+
args: --release --out dist
99+
sccache: 'true'
100+
- name: Upload wheels
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: wheels-windows-${{ matrix.platform.target }}
104+
path: dist
105+
106+
macos:
107+
runs-on: ${{ matrix.platform.runner }}
108+
strategy:
109+
matrix:
110+
platform:
111+
- runner: macos-12
112+
target: x86_64
113+
- runner: macos-14
114+
target: aarch64
115+
steps:
116+
- uses: actions/checkout@v4
117+
- name: Build wheels
118+
uses: PyO3/maturin-action@v1
119+
with:
120+
target: ${{ matrix.platform.target }}
121+
args: --release --out dist
122+
sccache: 'true'
123+
- name: Upload wheels
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: wheels-macos-${{ matrix.platform.target }}
127+
path: dist
128+
129+
release:
130+
name: Release
131+
runs-on: ubuntu-latest
132+
if: "startsWith(github.ref, 'refs/tags/')"
133+
needs: [linux, musllinux, windows, macos]
134+
environment: release
135+
steps:
136+
- uses: actions/download-artifact@v4
137+
- name: Publish to PyPI
138+
uses: PyO3/maturin-action@v1
139+
with:
140+
command: upload
141+
args: --non-interactive --skip-existing wheels-*/*

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[build-system]
2+
requires = ["maturin>=1.7,<2.0"]
3+
build-backend = "maturin"
4+
5+
[project]
6+
name = "cargo-ament-build"
7+
requires-python = ">=3.8"
8+
classifiers = [
9+
"Programming Language :: Rust",
10+
"Programming Language :: Python :: Implementation :: CPython",
11+
"Programming Language :: Python :: Implementation :: PyPy",
12+
]
13+
dynamic = ["version"]
14+
[tool.maturin]
15+
bindings = "bin"

0 commit comments

Comments
 (0)