pypi-wheels #33
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: pypi-wheels | |
on: | |
workflow_dispatch: | |
jobs: | |
build_windows: | |
env: | |
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/e83a8e64-04fc-45df-85c6-c2208d03bdb5/w_BaseKit_p_2024.2.0.635_offline.exe | |
WINDOWS_CPP_COMPONENTS: intel.oneapi.win.mkl.devel | |
VS_VER: vs2022 | |
ONEAPI_ROOT: C:/Program Files (x86)/Intel/oneAPI/ | |
CC: clang-cl.exe | |
CXX: clang-cl.exe | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [windows-latest] | |
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"] | |
compiler: ["clang-cl"] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install LLVM and Clang | |
uses: KyleMayes/install-llvm-action@v2 | |
with: | |
version: "17.0" | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x86_64 | |
- name: Install MKL | |
run: scripts/windowsoneapi_install.bat $WINDOWS_BASEKIT_URL $WINDOWS_CPP_COMPONENTS | |
shell: bash | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Add python requirements | |
run: python -m pip install --upgrade wheel setuptools && python -m pip install -r requirements.txt | |
- name: "Create build directory and run CMake" | |
run: > | |
cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DPIP_INSTALL=True -DBUILD_ASSET_WHEEL=True | |
-DCMAKE_C_COMPILER:FILEPATH="C:/Program Files/LLVM/bin/clang-cl.exe" | |
-DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files/LLVM/bin/clang-cl.exe" | |
-DCMAKE_LINKER:FILEPATH="C:/Program Files/LLVM/bin/lld-link.exe" | |
- name: "Build Project" | |
run: cmake --build build --target asset pypiwheel --config Release -- -j3 | |
- name: 'Upload Wheels' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist_${{ matrix.python-version }}_${{ matrix.platform }} | |
path: build/pypiwheel/asset_asrl/dist/*.whl | |
retention-days: 5 | |
build_linux_fast: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-22.04] | |
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"] | |
compiler: ["clang-13"] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Ubuntu dependencies | |
env: | |
COMPILER: ${{ matrix.compiler }} | |
run: bash $GITHUB_WORKSPACE/.github/install_ubuntu_dependencies.sh | |
- name: Add python requirements | |
run: python -m pip install --upgrade wheel setuptools && python -m pip install -r requirements.txt | |
- run: pip install patchelf auditwheel | |
- name: "Create build directory and run CMake" | |
run: cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DPIP_INSTALL=True -DBUILD_ASSET_WHEEL=True | |
- name: "Build Project" | |
run: cmake --build build --target asset pypiwheel --config Release -- -j2 | |
- name: Audit Wheel Test | |
run: auditwheel show build/pypiwheel/asset_asrl/dist/*.whl | |
- name: Audit Wheel Repair | |
run: auditwheel repair --plat manylinux_2_35_x86_64 build/pypiwheel/asset_asrl/dist/*.whl | |
- name: 'Upload Wheels' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist_${{ matrix.python-version }}_${{ matrix.platform }} | |
path: wheelhouse/*.whl | |
retention-days: 5 | |
upload: | |
needs: [build_windows,build_linux_fast] | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest] | |
python-version: ["3.9"] | |
compiler: ["clang-13"] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/download-artifact@v3 | |
with: | |
path: dists/ | |
- run: mkdir wheels | |
- name: Copy to Target | |
run: cp -r dists/dist_*/. wheels/ | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: wheels/ | |
- name: 'Upload Wheels To GitHub' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: All Wheels | |
path: wheels/ | |
retention-days: 5 | |
#- name: Publish package to TestPyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
# repository_url: https://test.pypi.org/legacy/ | |
# packages_dir: wheels/ |