Build #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- "**/**.md" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
#os: [ubuntu-latest, windows-latest, ubuntu-22.04-arm64, macos-13, macos-latest] | |
os: [windows-11-arm64] | |
python-version: [3.9] | |
if: startsWith(github.event.head_commit.message, 'Release') || github.event_name == 'workflow_dispatch' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install Visual Studio Build Tools | |
shell: powershell | |
run: | | |
$ProgressPreference = 'SilentlyContinue' | |
Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_buildtools.exe | |
Start-Process -FilePath .\vs_buildtools.exe -ArgumentList "--quiet", "--wait", "--norestart", "--nocache", ` | |
"--installPath", "C:\BuildTools", ` | |
"--add", "Microsoft.VisualStudio.Component.VC.Tools.ARM64", ` | |
"--add", "Microsoft.VisualStudio.Component.Windows11SDK.22000" -NoNewWindow -Wait | |
Remove-Item .\vs_buildtools.exe | |
- name: Add Build Tools to PATH | |
shell: powershell | |
run: | | |
$env:PATH += ";C:\BuildTools\MSBuild\Current\Bin;C:\BuildTools\VC\Tools\MSVC\14.37.32822\bin\Hostx64\arm64" | |
echo "C:\BuildTools\MSBuild\Current\Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
echo "C:\BuildTools\VC\Tools\MSVC\14.37.32822\bin\Hostx64\arm64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Diagnose Environment | |
shell: powershell | |
run: | | |
# Check PATH environment variable | |
Write-Host "Current PATH:" | |
$env:PATH -split ';' | ForEach-Object { Write-Host $_ } | |
# Check for Visual Studio installation | |
Write-Host "`nChecking for Visual Studio installation:" | |
if (Test-Path "C:\Program Files (x86)\Microsoft Visual Studio") { | |
Get-ChildItem "C:\Program Files (x86)\Microsoft Visual Studio" -Directory | |
} else { | |
Write-Host "Visual Studio directory not found" | |
} | |
# Check for MSBuild | |
Write-Host "`nChecking for MSBuild:" | |
$msbuildPath = (Get-Command msbuild -ErrorAction SilentlyContinue).Source | |
if ($msbuildPath) { | |
Write-Host "MSBuild found at: $msbuildPath" | |
} else { | |
Write-Host "MSBuild not found in PATH" | |
} | |
# Check for vcvarsall.bat | |
Write-Host "`nChecking for vcvarsall.bat:" | |
$vcvarsallPath = Get-ChildItem -Path "C:\Program Files (x86)\Microsoft Visual Studio" -Recurse -Filter "vcvarsall.bat" -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName | |
if ($vcvarsallPath) { | |
Write-Host "vcvarsall.bat found at: $vcvarsallPath" | |
} else { | |
Write-Host "vcvarsall.bat not found" | |
} | |
# List Visual C++ redistributables | |
Write-Host "`nInstalled Visual C++ Redistributables:" | |
Get-WmiObject Win32_Product | Where-Object { $_.Name -like "Microsoft Visual C++*" } | ForEach-Object { Write-Host $_.Name, $_.Version } | |
# - name: Install Visual C++ Build Tools | |
# uses: microsoft/setup-msbuild@v2 | |
# if: ${{ matrix.os == 'windows-11-arm64' }} | |
# with: | |
# msbuild-architecture: arm64 | |
# vswhere-path: 'C:\Program Files (x86)\Microsoft Visual Studio\Installer' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install cffi cibuildwheel wheel | |
- name: Build and test wheels | |
env: | |
CIBW_ARCHS: "auto64" | |
CIBW_SKIP: "cp36-* cp37-* pp37-* pp310-*" | |
CC: clang | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
- name: Save Wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl |