Skip to content

Commit 72ed603

Browse files
committed
fix: Update CI to install libudev
1 parent a2ef005 commit 72ed603

1 file changed

Lines changed: 60 additions & 35 deletions

File tree

.github/workflows/CI.yml

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# This file is autogenerated by maturin v1.8.4
1+
# This file is autogenerated by maturin v1.13.3
22
# To update, run
33
#
4-
# maturin generate-ci github
4+
# maturin generate-ci github -m rust/Cargo.toml
55
#
6+
# NOTE: After regenerating, re-add the `before-script-linux` blocks under the
7+
# manylinux and musllinux jobs below. They install libudev development headers
8+
# inside the build container; without them, `libudev-sys` (pulled in by
9+
# twinleaf -> serialport -> libudev) fails to link.
610
name: CI
711

812
on:
@@ -37,19 +41,31 @@ jobs:
3741
- runner: ubuntu-latest
3842
target: ppc64le
3943
steps:
40-
- uses: actions/checkout@v4
41-
- uses: actions/setup-python@v5
44+
- uses: actions/checkout@v6
45+
- uses: actions/setup-python@v6
4246
with:
43-
python-version: 3.x
47+
python-version: "3.12"
4448
- name: Build wheels
4549
uses: PyO3/maturin-action@v1
4650
with:
4751
target: ${{ matrix.platform.target }}
48-
args: --release --out dist --find-interpreter
52+
args: --release --out dist --find-interpreter --manifest-path rust/Cargo.toml
4953
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
5054
manylinux: auto
55+
before-script-linux: |
56+
# serialport-rs links against libudev on Linux, so the dev headers
57+
# must be present in whichever build container maturin-action picks.
58+
if command -v yum > /dev/null 2>&1; then
59+
yum install -y systemd-devel
60+
elif command -v dnf > /dev/null 2>&1; then
61+
dnf install -y systemd-devel
62+
elif command -v apk > /dev/null 2>&1; then
63+
apk add --no-cache eudev-dev pkgconfig
64+
elif command -v apt-get > /dev/null 2>&1; then
65+
apt-get update && apt-get install -y libudev-dev pkg-config
66+
fi
5167
- name: Upload wheels
52-
uses: actions/upload-artifact@v4
68+
uses: actions/upload-artifact@v6
5369
with:
5470
name: wheels-linux-${{ matrix.platform.target }}
5571
path: dist
@@ -68,19 +84,23 @@ jobs:
6884
- runner: ubuntu-latest
6985
target: armv7
7086
steps:
71-
- uses: actions/checkout@v4
72-
- uses: actions/setup-python@v5
87+
- uses: actions/checkout@v6
88+
- uses: actions/setup-python@v6
7389
with:
74-
python-version: 3.x
90+
python-version: "3.12"
7591
- name: Build wheels
7692
uses: PyO3/maturin-action@v1
7793
with:
7894
target: ${{ matrix.platform.target }}
79-
args: --release --out dist --find-interpreter
95+
args: --release --out dist --find-interpreter --manifest-path rust/Cargo.toml
8096
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
8197
manylinux: musllinux_1_2
98+
before-script-linux: |
99+
# serialport-rs links against libudev on Linux; Alpine ships the
100+
# development headers as eudev-dev.
101+
apk add --no-cache eudev-dev pkgconfig
82102
- name: Upload wheels
83-
uses: actions/upload-artifact@v4
103+
uses: actions/upload-artifact@v6
84104
with:
85105
name: wheels-musllinux-${{ matrix.platform.target }}
86106
path: dist
@@ -92,22 +112,27 @@ jobs:
92112
platform:
93113
- runner: windows-latest
94114
target: x64
115+
python_arch: x64
95116
- runner: windows-latest
96117
target: x86
118+
python_arch: x86
119+
- runner: windows-11-arm
120+
target: aarch64
121+
python_arch: arm64
97122
steps:
98-
- uses: actions/checkout@v4
99-
- uses: actions/setup-python@v5
123+
- uses: actions/checkout@v6
124+
- uses: actions/setup-python@v6
100125
with:
101-
python-version: 3.x
102-
architecture: ${{ matrix.platform.target }}
126+
python-version: "3.13"
127+
architecture: ${{ matrix.platform.python_arch }}
103128
- name: Build wheels
104129
uses: PyO3/maturin-action@v1
105130
with:
106131
target: ${{ matrix.platform.target }}
107-
args: --release --out dist --find-interpreter
132+
args: --release --out dist --find-interpreter --manifest-path rust/Cargo.toml
108133
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
109134
- name: Upload wheels
110-
uses: actions/upload-artifact@v4
135+
uses: actions/upload-artifact@v6
111136
with:
112137
name: wheels-windows-${{ matrix.platform.target }}
113138
path: dist
@@ -117,38 +142,38 @@ jobs:
117142
strategy:
118143
matrix:
119144
platform:
120-
- runner: macos-latest
121-
target: aarch64
122145
- runner: macos-latest
123146
target: x86_64
147+
- runner: macos-latest
148+
target: aarch64
124149
steps:
125-
- uses: actions/checkout@v4
126-
- uses: actions/setup-python@v5
150+
- uses: actions/checkout@v6
151+
- uses: actions/setup-python@v6
127152
with:
128-
python-version: 3.x
153+
python-version: "3.12"
129154
- name: Build wheels
130155
uses: PyO3/maturin-action@v1
131156
with:
132157
target: ${{ matrix.platform.target }}
133-
args: --release --out dist --find-interpreter
158+
args: --release --out dist --find-interpreter --manifest-path rust/Cargo.toml
134159
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
135160
- name: Upload wheels
136-
uses: actions/upload-artifact@v4
161+
uses: actions/upload-artifact@v6
137162
with:
138163
name: wheels-macos-${{ matrix.platform.target }}
139164
path: dist
140165

141166
sdist:
142167
runs-on: ubuntu-latest
143168
steps:
144-
- uses: actions/checkout@v4
169+
- uses: actions/checkout@v6
145170
- name: Build sdist
146171
uses: PyO3/maturin-action@v1
147172
with:
148173
command: sdist
149-
args: --out dist
174+
args: --out dist --manifest-path rust/Cargo.toml
150175
- name: Upload sdist
151-
uses: actions/upload-artifact@v4
176+
uses: actions/upload-artifact@v6
152177
with:
153178
name: wheels-sdist
154179
path: dist
@@ -166,16 +191,16 @@ jobs:
166191
# Used to generate artifact attestation
167192
attestations: write
168193
steps:
169-
- uses: actions/download-artifact@v4
194+
- uses: actions/download-artifact@v7
170195
- name: Generate artifact attestation
171-
uses: actions/attest-build-provenance@v2
196+
uses: actions/attest@v4
172197
with:
173198
subject-path: 'wheels-*/*'
199+
- name: Install uv
200+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
201+
uses: astral-sh/setup-uv@v7
174202
- name: Publish to PyPI
175203
if: ${{ startsWith(github.ref, 'refs/tags/') }}
176-
uses: PyO3/maturin-action@v1
204+
run: uv publish 'wheels-*/*'
177205
env:
178-
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
179-
with:
180-
command: upload
181-
args: --non-interactive --skip-existing wheels-*/*
206+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)