Skip to content

Commit 4cbe791

Browse files
authored
Upload more wheels (#737)
1 parent baa87f8 commit 4cbe791

File tree

2 files changed

+57
-16
lines changed

2 files changed

+57
-16
lines changed

.github/workflows/python-publish.yml

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,66 @@ on:
1313
types: [published]
1414

1515
jobs:
16-
release:
17-
name: Releasing to PyPi
16+
wheels:
17+
name: Build wheels
1818
runs-on: ubuntu-latest
19-
environment:
20-
name: release
21-
url: https://pypi.org/manage/project/deebot-client/
22-
permissions:
23-
contents: write
24-
id-token: write
19+
strategy:
20+
matrix:
21+
python-version:
22+
- "3.12"
23+
- "3.13"
24+
linux-compatibility:
25+
- "manylinux_2_34"
26+
- "musllinux_1_2"
2527
steps:
2628
- name: ⤵️ Check out code from GitHub
2729
uses: actions/[email protected]
28-
- name: 🏗 Set up uv
30+
- name: 🏗 Set up uv and Python ${{ matrix.python-version }}
2931
uses: astral-sh/setup-uv@v5
3032
with:
3133
enable-cache: true
34+
python-version: ${{ matrix.python-version }}
3235
- name: 🏗 Set package version
3336
run: |
3437
sed -i "s/^version = \".*\"/version = \"${{ github.event.release.tag_name }}\"/" pyproject.toml
3538
- name: 📦 Build package
36-
run: uv build
37-
- name: 🚀 Publish to PyPi
38-
run: uv publish
39-
- name: ✍️ Sign published artifacts
40-
uses: sigstore/[email protected]
39+
run: uv build --config-settings build-args='--compatibility ${{ matrix.linux-compatibility }}'
40+
- name: ⬆️ Upload wheels
41+
uses: actions/upload-artifact@v4
4142
with:
42-
inputs: ./dist/*.tar.gz ./dist/*.whl
43-
release-signing-artifacts: true
43+
name: wheels-${{ matrix.python-version }}-${{ matrix.linux-compatibility }}
44+
path: dist
45+
46+
release:
47+
name: Releasing to PyPi
48+
runs-on: ubuntu-latest
49+
needs: ["wheels"]
50+
environment:
51+
name: release
52+
url: https://pypi.org/manage/project/deebot-client/
53+
permissions:
54+
contents: write
55+
id-token: write
56+
steps:
57+
- name: ⤵️ Check out code from GitHub
58+
uses: actions/[email protected]
59+
- name: 🏗 Set up uv
60+
uses: astral-sh/setup-uv@v5
61+
with:
62+
enable-cache: true
63+
- name: 🏗 Set package version
64+
run: |
65+
sed -i "s/^version = \".*\"/version = \"${{ github.event.release.tag_name }}\"/" pyproject.toml
66+
- name: 📦 Build source package
67+
run: uv build --sdist
68+
- name: ⬇️ Download wheels
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: wheels-*
72+
- name: 🚀 Publish to PyPi
73+
run: uv publish
74+
- name: ✍️ Sign published artifacts
75+
uses: sigstore/[email protected]
76+
with:
77+
inputs: ./dist/*.tar.gz ./dist/*.whl
78+
release-signing-artifacts: true

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ version = "0.0.0"
4343
"Bug Reports" = "https://github.com/DeebotUniverse/client.py/issues"
4444

4545
[tool.uv]
46+
# Rebuild package when any rust files change
47+
cache-keys = [
48+
{ file = "pyproject.toml" },
49+
{ file = "Cargo.toml" },
50+
{ file = "**/*.rs" },
51+
]
4652
dev-dependencies = [
4753
"mypy==1.14.1",
4854
"pre-commit==4.0.1",

0 commit comments

Comments
 (0)