-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (82 loc) · 2.59 KB
/
build.yml
File metadata and controls
95 lines (82 loc) · 2.59 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
name: Build Wheels
on:
push:
branches:
- "*"
- "*/*"
- "**"
pull_request:
branches: [main]
jobs:
build_sdist:
name: Build source
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build source and wheel
run: |
python -m pip install --upgrade pip build
python -m build --outdir=wheelhouse
- name: Upload sdist and wheel to github
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: wheelhouse/*
if-no-files-found: error
build_wheels:
name: Building wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Cache cibuildwheel
uses: actions/cache@v4
with:
path: |
~/.cache/cibuildwheel
~/Library/Caches/cibuildwheel
C:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache
key: cibuildwheel-${{ runner.os }}
# Pre-download virtualenv for macOS
- name: Pre-download virtualenv (macOS)
if: runner.os == 'macOS'
run: |
mkdir -p ~/Library/Caches/cibuildwheel
curl -L -H "Authorization: Bearer $GITHUB_TOKEN" \
https://github.com/pypa/get-virtualenv/raw/20.26.6/public/virtualenv.pyz \
-o ~/Library/Caches/cibuildwheel/virtualenv-20.26.6.pyz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Pre-download virtualenv for Windows
- name: Pre-download virtualenv (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$cache = "$env:LOCALAPPDATA\pypa\cibuildwheel\Cache"
New-Item -ItemType Directory -Force -Path $cache
Invoke-WebRequest `
-Headers @{Authorization="Bearer $env:GITHUB_TOKEN"} `
-Uri "https://github.com/pypa/get-virtualenv/raw/20.26.6/public/virtualenv.pyz" `
-OutFile "$cache\virtualenv-20.26.6.pyz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.21
env:
CIBW_SKIP: "pp38-*"
CIBW_BUILD_VERBOSITY: 1
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: wheelhouse/*.whl