|
4 | 4 | push:
|
5 | 5 | tags:
|
6 | 6 | - "v*"
|
| 7 | + workflow_dispatch: |
7 | 8 |
|
8 | 9 | permissions:
|
9 | 10 | id-token: write
|
10 | 11 | contents: write
|
11 | 12 |
|
12 | 13 | jobs:
|
13 |
| - build: |
14 |
| - runs-on: ubuntu-latest |
15 |
| - |
| 14 | + build-wheels: |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + platform: |
| 18 | + - runs-on: ubuntu-24.04 |
| 19 | + arch: x86_64 |
| 20 | + - runs-on: buildjet-2vcpu-ubuntu-2204-arm |
| 21 | + arch: arm64 |
| 22 | + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
| 23 | + runs-on: ${{ matrix.platform.runs-on }} |
16 | 24 | steps:
|
17 | 25 | - uses: actions/checkout@v4
|
18 |
| - with: |
19 |
| - fetch-depth: 0 |
| 26 | + - uses: astral-sh/setup-uv@v4 |
20 | 27 | - uses: actions/setup-python@v2
|
21 | 28 | with:
|
22 |
| - python-version: "3.11" |
| 29 | + python-version: ${{ matrix.python-version }} |
23 | 30 |
|
24 |
| - - name: Install dependencies |
25 |
| - run: pip install hatch |
| 31 | + - name: Install valgrind |
| 32 | + run: sudo apt-get install valgrind -y |
26 | 33 |
|
27 | 34 | - name: Build the library
|
28 |
| - run: hatch build |
| 35 | + run: uv build --wheel --out-dir dist/ |
| 36 | + |
| 37 | + - uses: actions/upload-artifact@v4 |
| 38 | + with: |
| 39 | + name: wheel-${{ matrix.python-version }}-${{ runner.os }} |
| 40 | + path: dist/*.whl |
| 41 | + |
| 42 | + publish-wheels: |
| 43 | + needs: build-wheels |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - uses: actions/download-artifact@v4 |
| 47 | + with: |
| 48 | + merge-multiple: true |
| 49 | + path: dist/ |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + - uses: astral-sh/setup-uv@v4 |
| 52 | + - uses: actions/setup-python@v2 |
| 53 | + with: |
| 54 | + python-version: "3.12" |
| 55 | + - name: Build the source dist |
| 56 | + run: uv build --sdist --out-dir dist/ |
| 57 | + |
| 58 | + - name: List artifacts |
| 59 | + run: ls -l dist/ |
29 | 60 |
|
30 |
| - - name: Publish package distributions to PyPI |
31 |
| - uses: pypa/gh-action-pypi-publish@release/v1 |
| 61 | + - if: github.event_name == 'push' |
| 62 | + name: Publish to PyPI |
| 63 | + run: uv publish --trusted-publishing=always dist/* |
32 | 64 |
|
33 |
| - - name: Create a draft release |
| 65 | + - if: github.event_name == 'push' |
| 66 | + name: Create a draft release |
34 | 67 | run: |
|
35 |
| - NEW_VERSION=$(hatch project metadata | jq -r '.version') |
36 |
| - gh release create v$NEW_VERSION --title "v$NEW_VERSION" --generate-notes -d |
| 68 | + VERSION="${{ github.ref_name }}" |
| 69 | + gh release create $VERSION --title $VERSION --generate-notes -d |
37 | 70 | env:
|
38 | 71 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
0 commit comments