-
Notifications
You must be signed in to change notification settings - Fork 141
111 lines (94 loc) · 3.19 KB
/
Copy pathbuild.yml
File metadata and controls
111 lines (94 loc) · 3.19 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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: "0 0 * * 0" # Runs every Sunday at midnight UTC
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build wheels (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
- windows-latest
# Pinned: Homebrew bottles on macos-latest (macOS 26) carry
# minos 26.0, which delocate rejects against the 15.0 wheel
# target below. Keep this image and MACOSX_DEPLOYMENT_TARGET
# in sync if either changes.
- macos-15
steps:
- name: Checkout source
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install gfortran (macOS)
if: runner.os == 'macOS'
run: |
brew install gcc || brew link --overwrite gcc
echo "$(brew --prefix gcc)/bin" >> "$GITHUB_PATH"
"$(brew --prefix gcc)/bin/gfortran" --version
- name: Install MinGW via Chocolatey (Windows)
if: runner.os == 'Windows'
run: |
choco install -y mingw
$paths = @(
'C:\\ProgramData\\mingw64\\mingw64\\bin',
'C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin',
'C:\\tools\\mingw64\\bin',
'C:\\ProgramData\\chocolatey\\bin'
)
foreach ($p in $paths) { if (Test-Path $p) { echo $p >> $env:GITHUB_PATH; Write-Host "Added $p to PATH" } }
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install numpy cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheels
env:
CIBW_ARCHS_LINUX: x86_64
CIBW_ARCHS_MACOS: arm64
CIBW_ARCHS_WINDOWS: AMD64
CIBW_ENVIRONMENT_MACOS: "PATH=/opt/homebrew/bin:$PATH MACOSX_DEPLOYMENT_TARGET=15.0"
- name: Debug Windows native deps
if: failure() && runner.os == 'Windows'
shell: pwsh
run: |
Write-Host 'PATH:'
Write-Host $env:PATH
foreach ($cmd in @('gcc', 'gfortran', 'objdump')) {
try {
Write-Host "Command: $cmd"
Get-Command $cmd -ErrorAction Stop | Format-List *
} catch {
Write-Host "Missing command: $cmd"
}
}
$pyds = Get-ChildItem -Path . -Recurse -Filter '*.pyd' -ErrorAction SilentlyContinue
foreach ($pyd in $pyds) {
Write-Host "Inspecting $($pyd.FullName)"
try {
& objdump -p $pyd.FullName | Select-String 'DLL Name|Name:|ImageBase|Subsystem'
} catch {
Write-Host "objdump failed for $($pyd.FullName)"
}
}
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}
path: wheels/*.whl