Debian Codegraph @

.github/workflows/build.yml

raw
1 ---
2 name: Build
3
4 "on":
5 pull_request:
6 types:
7 - labeled
8 push:
9 branches:
10 - main
11 workflow_dispatch:
12 workflow_call:
13
14 permissions:
15 contents: read
16
17 jobs:
18 build:
19 if: github.event_name != 'pull_request' || github.event.label.name == 'build-wheels'
20 name: Build sdist and non-compiled wheel
21 runs-on: ubuntu-latest
22
23 steps:
24 - &checkout
25 name: Check out the repository
26 uses: actions/checkout@v7
27 with:
28 # To ensure hatch-vcs can get the correct version from the git history.
29 fetch-depth: 0
30
31 - name: Set up Python 3.14
32 uses: actions/setup-python@v7
33 with:
34 python-version: 3.14
35 check-latest: true
36
37 - &setup-uv
38 name: Install UV
39 uses: astral-sh/setup-uv@v7
40 with:
41 enable-cache: true
42 version-file: "pyproject.toml"
43
44 - name: Build sdist and wheel
45 env:
46 HATCH_BUILD_HOOK_ENABLE_MYPYC: false
47 run: uv build
48
49 - name: Upload sdist
50 uses: actions/[email protected]
51 with:
52 name: cibw-sdist
53 path: dist/*.tar.gz
54
55 - name: Upload wheel
56 uses: actions/[email protected]
57 with:
58 name: cibw-wheel-pure
59 path: dist/*.whl
60
61 build_wheels:
62 name: Build wheels for ${{ matrix.os }}
63 runs-on: ${{ matrix.runs-on }}
64 strategy:
65 matrix:
66 include:
67 - os: ubuntu-latest
68 runs-on: ubuntu-latest
69 - os: windows-latest
70 runs-on: windows-latest
71 - os: macos-latest
72 runs-on: macos-latest
73 - os: pyodide
74 runs-on: ubuntu-latest
75 platform: pyodide
76
77 steps:
78 - *checkout
79 - *setup-uv
80
81 - name: Build wheels
82 env:
83 CIBW_BUILD_FRONTEND: "build[uv]"
84 CIBW_ENVIRONMENT: "HATCH_BUILD_HOOK_ENABLE_MYPYC=true"
85 CIBW_PLATFORM: ${{ matrix.platform || 'auto' }}
86 CIBW_SKIP: "*-win32"
87 uses: pypa/[email protected]
88
89 - uses: actions/[email protected]
90 with:
91 name: cibw-wheels-${{ matrix.os }}
92 path: ./wheelhouse/*.whl