-
Notifications
You must be signed in to change notification settings - Fork 27
73 lines (61 loc) · 1.69 KB
/
Copy pathrelease.yml
File metadata and controls
73 lines (61 loc) · 1.69 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
name: Build and publish wheels
on:
# Build wheels on every push to master (but don't publish)
push:
branches: [master]
# Publish to PyPI when a release tag is pushed
release:
types: [published]
# Allow manual trigger
workflow_dispatch:
jobs:
build-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build source distribution
run: pipx run build --sdist
- uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/*.tar.gz
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux x86_64 — native
- os: ubuntu-latest
cibw_archs: x86_64
# Linux aarch64 — native ARM runner (no QEMU)
- os: ubuntu-24.04-arm
cibw_archs: aarch64
# macOS x86_64 + arm64 (cross-compile x86_64 via Rosetta 2)
- os: macos-14
cibw_archs: "x86_64 arm64"
steps:
- uses: actions/checkout@v6
- uses: pypa/cibuildwheel@v2.21
env:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}
path: wheelhouse/*.whl
# Publish to PyPI only on release
publish:
needs: [build-sdist, build-wheels]
runs-on: ubuntu-latest
if: github.event_name == 'release'
environment: pypi
permissions:
id-token: write # for trusted publishing
steps:
- uses: actions/download-artifact@v7
with:
path: dist
merge-multiple: true
- name: List artifacts
run: ls -lh dist/
- uses: pypa/gh-action-pypi-publish@release/v1