-
Notifications
You must be signed in to change notification settings - Fork 35
112 lines (97 loc) · 2.97 KB
/
cd.yml
File metadata and controls
112 lines (97 loc) · 2.97 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: wheels
on:
workflow_dispatch:
release:
types:
- published
pull_request:
paths:
- .github/workflows/cd.yml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3
jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v7.0.0
with:
name: cibw-sdist
path: dist/*.tar.gz
build_wheels:
name: "Wheels: ${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest, macos-15-intel]
include:
- os: ubuntu-latest
cibw_archs: x86_64
cibw_build: "*"
cibw_skip: "pp* *musllinux* cp314t*"
- os: ubuntu-24.04-arm
cibw_archs: aarch64
cibw_build: "*"
cibw_skip: "cp38* pp* *musllinux* cp314t*"
- os: windows-latest
cibw_archs: AMD64
cibw_build: "*"
cibw_skip: "pp* *musllinux* cp314t*"
- os: macos-latest
cibw_archs: arm64
cibw_build: "*"
cibw_skip: "pp* *musllinux* cp314t*"
- os: macos-15-intel
cibw_archs: x86_64
cibw_build: "*"
cibw_skip: "pp* *musllinux* cp314t*"
steps:
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- uses: pypa/cibuildwheel@v3.4
env:
# limited at least by availability of h5py, which skips pypy and musl
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_SKIP: ${{ matrix.cibw_skip }}
- name: Upload wheels
uses: actions/upload-artifact@v7.0.0
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: wheelhouse/*.whl
upload_all:
needs: [build_wheels, make_sdist]
environment: pypi
permissions:
id-token: write
attestations: write
contents: write
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v8
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Generate artifact attestations
uses: actions/attest-build-provenance@v4.1.0
with:
subject-path: "dist/*"
- uses: pypa/gh-action-pypi-publish@release/v1
- name: Upload source distribution to GitHub release
uses: softprops/action-gh-release@v2
with:
files: "dist/*.tar.gz"