-
Notifications
You must be signed in to change notification settings - Fork 7
106 lines (93 loc) · 6.57 KB
/
wheels.yml
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
name: Wheels
on:
workflow_dispatch:
release:
types:
- published
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2022, macos-13, macos-14]
max-parallel: 4
steps:
- uses: actions/checkout@v4
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
vcpkgGitCommitId: 055721089e8037d4d617250814d11f881e557549
- uses: pypa/[email protected]
if: startsWith(matrix.os, 'ubuntu')
env:
CIBW_ARCHS_LINUX: x86_64
CIBW_BUILD: cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64
CIBW_BUILD_VERBOSITY_LINUX: 1
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
# By default, cibuildwheel will perform a volume mount from the current root / to /host/ in the linux container,
# see see https://cibuildwheel.pypa.io/en/stable/options/#container-engine .
# CIBW_ENVIRONMENT_LINUX: SKBUILD_BUILD_TOOL_ARGS="-j 4" SKBUILD_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=/host/${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake;-DVCPKG_MANIFEST_FEATURES=python;-DPBAT_BUILD_SHARED_LIBS:BOOL=OFF;-DPBAT_ENABLE_PROFILER:BOOL=ON;-DPBAT_BUILD_PYTHON_BINDINGS:BOOL=ON;-DPBAT_BUILD_TESTS:BOOL=OFF;-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON;-DCMAKE_BUILD_TYPE=Release;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON"
CIBW_CONFIG_SETTINGS_LINUX: "cmake.args=-DPBAT_BUILD_PYTHON_BINDINGS:BOOL=ON;-DPBAT_BUILD_TESTS:BOOL=OFF;-DPBAT_ENABLE_PROFILER:BOOL=ON;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON;-DPBAT_BUILD_SHARED_LIBS:BOOL=OFF;-DPOSITION_INDEPENDENT_CODE:BOOL=ON;-DCMAKE_TOOLCHAIN_FILE='/host/${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake';-DVCPKG_MANIFEST_FEATURES=python;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON;${{ matrix.cmake_cxx_compiler }} build.tool-args=-j4"
# - name: Set macOS environment variables
# if: startsWith(matrix.os, 'mac')
# shell: bash
# # Environment variables can be read directly on Windows and MacOS, but not Linux.
# # See https://cibuildwheel.pypa.io/en/stable/options/#environment-pass
# run: |
# echo "SKBUILD_CMAKE_ARGS=-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake;-DVCPKG_MANIFEST_FEATURES=python;-DPBAT_BUILD_SHARED_LIBS:BOOL=OFF;-DPBAT_ENABLE_PROFILER:BOOL=ON;-DPBAT_BUILD_PYTHON_BINDINGS:BOOL=ON;-DPBAT_BUILD_TESTS:BOOL=OFF;-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON;-DCMAKE_BUILD_TYPE=Release;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON" >> $GITHUB_ENV
- uses: pypa/[email protected]
if: startsWith(matrix.os, 'macos-13')
env:
# SKBUILD_BUILD_TOOL_ARGS: -j 4
MACOSX_DEPLOYMENT_TARGET: "13.0"
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_BUILD: cp310-macosx_x86_64 cp311-macosx_x86_64 cp312-macosx_x86_64 cp310_macosx_universal2 cp311_macosx_universal2 cp312_macosx_universal2
CIBW_BUILD_VERBOSITY_MACOS: 1
CIBW_CONFIG_SETTINGS_MACOS: "cmake.args=-DPBAT_BUILD_PYTHON_BINDINGS:BOOL=ON;-DPBAT_BUILD_TESTS:BOOL=OFF;-DPBAT_ENABLE_PROFILER:BOOL=ON;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON;-DPBAT_BUILD_SHARED_LIBS:BOOL=OFF;-DPOSITION_INDEPENDENT_CODE:BOOL=ON;-DCMAKE_TOOLCHAIN_FILE='${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake';-DVCPKG_MANIFEST_FEATURES=python;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON;${{ matrix.cmake_cxx_compiler }} build.tool-args=-j4"
- uses: pypa/[email protected]
if: startsWith(matrix.os, 'macos-14')
env:
# SKBUILD_BUILD_TOOL_ARGS: -j 4
MACOSX_DEPLOYMENT_TARGET: "14.0"
CIBW_ARCHS_MACOS: arm64 universal2
CIBW_BUILD: cp310-macosx_arm64 cp311-macosx_arm64 cp312-macosx_arm64 cp310_macosx_universal2 cp311_macosx_universal2 cp312_macosx_universal2
CIBW_BUILD_VERBOSITY_MACOS: 1
CIBW_CONFIG_SETTINGS_MACOS: "cmake.args=-DPBAT_BUILD_PYTHON_BINDINGS:BOOL=ON;-DPBAT_BUILD_TESTS:BOOL=OFF;-DPBAT_ENABLE_PROFILER:BOOL=ON;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON;-DPBAT_BUILD_SHARED_LIBS:BOOL=OFF;-DPOSITION_INDEPENDENT_CODE:BOOL=ON;-DCMAKE_TOOLCHAIN_FILE='${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake';-DVCPKG_MANIFEST_FEATURES=python;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON;${{ matrix.cmake_cxx_compiler }} build.tool-args=-j4"
- uses: pypa/[email protected]
if: startsWith(matrix.os, 'windows')
env:
CIBW_ARCHS_WINDOWS: AMD64
CIBW_BUILD: cp310-win_amd64 cp311-win_amd64 cp312-win_amd64
CIBW_BUILD_VERBOSITY_WINDOWS: 1
# Environment variables can be read directly on Windows and MacOS, but not Linux.
# See https://cibuildwheel.pypa.io/en/stable/options/#environment-pass
# SKBUILD_BUILD_TOOL_ARGS: /p:CL_MPCount=4
# SKBUILD_CMAKE_ARGS: -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake;-DVCPKG_MANIFEST_FEATURES=python;-DPBAT_BUILD_SHARED_LIBS:BOOL=OFF;-DPBAT_ENABLE_PROFILER:BOOL=ON;-DPBAT_BUILD_PYTHON_BINDINGS:BOOL=ON;-DPBAT_BUILD_TESTS:BOOL=OFF;-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON;-DCMAKE_CXX_FLAGS="/EHsc /MP /bigobj;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON"
CIBW_CONFIG_SETTINGS_WINDOWS: "cmake.args=-DPBAT_BUILD_PYTHON_BINDINGS:BOOL=ON;-DPBAT_BUILD_TESTS:BOOL=OFF;-DPBAT_ENABLE_PROFILER:BOOL=ON;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON;-DPBAT_BUILD_SHARED_LIBS:BOOL=OFF;-DPOSITION_INDEPENDENT_CODE:BOOL=ON;-DCMAKE_TOOLCHAIN_FILE='${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake';-DVCPKG_MANIFEST_FEATURES=python;-DPBAT_PROFILE_ON_DEMAND:BOOL=ON;-DCMAKE_CXX_FLAGS='/EHsc /MP /bigobj';${{ matrix.cmake_cxx_compiler }} build.tool-args=/p:CL_MPCount=4"
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: wheelhouse/*.whl
upload_all:
name: Upload release
needs: [build_wheels]
runs-on: ubuntu-latest
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch')
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1