-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (70 loc) · 2.35 KB
/
Copy pathwheels.yml
File metadata and controls
74 lines (70 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Wheels
on:
push:
tags: ["v*"]
workflow_dispatch:
# Builds the Python wheels (`pip install sqlite-predict`). Each wheel bundles the
# zero-dependency loadable compiled for its platform. Staging runs `make
# python-src` on the host to drop the amalgamation + SQLite ext headers into the
# package; cibuildwheel then compiles them per platform.
#
# Publishing uses PyPI Trusted Publishing (OIDC) -- no token in GitHub. ONE-TIME
# setup on PyPI: create the `sqlite-predict` project's trusted publisher
# pointing at this repo, workflow `wheels.yml`, and environment `pypi`
# (https://docs.pypi.org/trusted-publishers/). The `publish` job only runs on a
# v* tag; plain pushes / workflow_dispatch just build wheels.
jobs:
wheels:
name: wheels (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v7
- name: Stage amalgamation into the package
run: make python-src
- name: Build wheels
uses: pypa/cibuildwheel@v4.1
with:
package-dir: bindings/python
env:
# the loadable is ABI-agnostic, so one CPython build per platform gives
# one py3-none-<platform> wheel usable by any Python there. Skip musl.
CIBW_BUILD: "cp312-*"
CIBW_SKIP: "*-musllinux*"
CIBW_BUILD_VERBOSITY: "1"
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
sdist:
name: sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Stage amalgamation into the package
run: make python-src
- name: Build sdist
run: pipx run build --sdist --outdir wheelhouse bindings/python
- uses: actions/upload-artifact@v7
with:
name: sdist
path: wheelhouse/*.tar.gz
publish:
name: publish to PyPI
needs: [wheels, sdist]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
environment: pypi
permissions:
id-token: write # PyPI Trusted Publishing (OIDC), no token needed
steps:
- uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist