|
13 | 13 | types: [published]
|
14 | 14 |
|
15 | 15 | jobs:
|
16 |
| - release: |
17 |
| - name: Releasing to PyPi |
| 16 | + wheels: |
| 17 | + name: Build wheels |
18 | 18 | 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" |
25 | 27 | steps:
|
26 | 28 | - name: ⤵️ Check out code from GitHub
|
27 | 29 |
|
28 |
| - - name: 🏗 Set up uv |
| 30 | + - name: 🏗 Set up uv and Python ${{ matrix.python-version }} |
29 | 31 | uses: astral-sh/setup-uv@v5
|
30 | 32 | with:
|
31 | 33 | enable-cache: true
|
| 34 | + python-version: ${{ matrix.python-version }} |
32 | 35 | - name: 🏗 Set package version
|
33 | 36 | run: |
|
34 | 37 | sed -i "s/^version = \".*\"/version = \"${{ github.event.release.tag_name }}\"/" pyproject.toml
|
35 | 38 | - name: 📦 Build package
|
36 |
| - run: uv build |
37 |
| - - name: 🚀 Publish to PyPi |
38 |
| - run: uv publish |
39 |
| - - name: ✍️ Sign published artifacts |
40 |
| - |
| 39 | + run: uv build --config-settings build-args='--compatibility ${{ matrix.linux-compatibility }}' |
| 40 | + - name: ⬆️ Upload wheels |
| 41 | + uses: actions/upload-artifact@v4 |
41 | 42 | 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 | + |
| 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 | + |
| 76 | + with: |
| 77 | + inputs: ./dist/*.tar.gz ./dist/*.whl |
| 78 | + release-signing-artifacts: true |
0 commit comments