msyrs/scripts/win/build.ps1
2024-11-22 14:42:46 +00:00

23 lines
684 B
PowerShell

# run command: maturin --help. if it fails, print the error message and exit
try {
maturin --help > $null
} catch {
Write-Error "Failed to run maturin --help: $_"
exit 1
}
# delete any existing build directory
Remove-Item -Path ./build -Recurse -Force -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path ./build > $null
# copy ./src/msyrs.pyi to ./msyrs.pyi
Copy-Item -Path ./src/msyrs.pyi -Destination ./msyrs.pyi
maturin build --release --sdist --out ./build/
$whl = Get-ChildItem -Path ./build/*.whl
# rename the wheel wheel.whl to wheel.zip
Rename-Item -Path $whl -NewName ($whl.BaseName + ".zip")
# delete the pyi file
Remove-Item -Path ./msyrs.pyi