feat: publish platform-tagged wheels for all target runtimes

This commit is contained in:
Miha Kralj
2026-03-01 17:47:31 -08:00
parent aa229caf99
commit d4d0646c4f
2 changed files with 25 additions and 1 deletions
+23 -1
View File
@@ -34,31 +34,37 @@ jobs:
rid: win-x64 rid: win-x64
native_dir: win_amd64 native_dir: win_amd64
native_file: quantalib_native.dll native_file: quantalib_native.dll
wheel_platform_tag: win_amd64
- wheel_id: win-arm64 - wheel_id: win-arm64
os: windows-latest os: windows-latest
rid: win-arm64 rid: win-arm64
native_dir: win_arm64 native_dir: win_arm64
native_file: quantalib_native.dll native_file: quantalib_native.dll
wheel_platform_tag: win_arm64
- wheel_id: linux-amd64 - wheel_id: linux-amd64
os: ubuntu-latest os: ubuntu-latest
rid: linux-x64 rid: linux-x64
native_dir: linux_x86_64 native_dir: linux_x86_64
native_file: quantalib_native.so native_file: quantalib_native.so
wheel_platform_tag: linux_x86_64
- wheel_id: linux-arm64 - wheel_id: linux-arm64
os: ubuntu-24.04-arm os: ubuntu-24.04-arm
rid: linux-arm64 rid: linux-arm64
native_dir: linux_arm64 native_dir: linux_arm64
native_file: quantalib_native.so native_file: quantalib_native.so
wheel_platform_tag: linux_aarch64
- wheel_id: macos-amd64 - wheel_id: macos-amd64
os: macos-15-intel os: macos-15-intel
rid: osx-x64 rid: osx-x64
native_dir: macosx_x86_64 native_dir: macosx_x86_64
native_file: quantalib_native.dylib native_file: quantalib_native.dylib
wheel_platform_tag: macosx_10_13_x86_64
- wheel_id: macos-arm64 - wheel_id: macos-arm64
os: macos-14 os: macos-14
rid: osx-arm64 rid: osx-arm64
native_dir: macosx_arm64 native_dir: macosx_arm64
native_file: quantalib_native.dylib native_file: quantalib_native.dylib
wheel_platform_tag: macosx_11_0_arm64
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -119,9 +125,25 @@ jobs:
- name: Build wheel - name: Build wheel
shell: pwsh shell: pwsh
run: | run: |
python -m pip install --upgrade pip build hatchling Remove-Item ./python/dist/*.whl -ErrorAction SilentlyContinue
python -m pip install --upgrade pip build hatchling wheel
python -m build --wheel ./python python -m build --wheel ./python
python -m wheel tags `
--python-tag py3 `
--abi-tag none `
--platform-tag ${{ matrix.wheel_platform_tag }} `
--remove `
./python/dist/*.whl
$taggedWheel = Get-ChildItem ./python/dist/*.whl | Select-Object -First 1
if (-not $taggedWheel) {
Write-Error "No wheel found after tagging"
exit 1
}
"Tagged wheel: $($taggedWheel.Name)"
- name: Upload wheel artifact - name: Upload wheel artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
+2
View File
@@ -7,7 +7,9 @@ from pathlib import Path
_PLATFORM_MAP: dict[tuple[str, str], str] = { _PLATFORM_MAP: dict[tuple[str, str], str] = {
("Windows", "AMD64"): "win_amd64/quantalib_native.dll", ("Windows", "AMD64"): "win_amd64/quantalib_native.dll",
("Windows", "ARM64"): "win_arm64/quantalib_native.dll",
("Linux", "x86_64"): "linux_x86_64/quantalib_native.so", ("Linux", "x86_64"): "linux_x86_64/quantalib_native.so",
("Linux", "aarch64"): "linux_arm64/quantalib_native.so",
("Darwin", "arm64"): "macosx_arm64/quantalib_native.dylib", ("Darwin", "arm64"): "macosx_arm64/quantalib_native.dylib",
("Darwin", "x86_64"): "macosx_x86_64/quantalib_native.dylib", ("Darwin", "x86_64"): "macosx_x86_64/quantalib_native.dylib",
} }