docs: update README.md #9
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: Wheel | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
jobs: | |
build_wheels_windows: | |
name: Build Wheels for Python ${{ matrix.python }} on Windows | |
strategy: | |
fail-fast: false | |
matrix: | |
python: [ "3.9", "3.10", "3.11", "3.12" ] | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
- name: Set up MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x86_64 | |
toolset: 14.3 | |
- name: Set up CMake and Ninja | |
uses: lukka/get-cmake@latest | |
- name: Set up Conan | |
run: | | |
python -m pip install -U conan | |
conan profile detect --force | |
conan export third_party/funchook --version 1.1.3 | |
conan install . --build=missing -pr:a .github/conan_profiles/windows | |
- name: Build Wheels | |
run: | | |
python -m pip install -U pip | |
pip install wheel | |
python -m pip wheel . --no-deps --wheel-dir=wheelhouse --verbose | |
- name: Test Wheels | |
run: | | |
pip install pytest | |
Get-ChildItem ./wheelhouse/ -Filter *.whl | ForEach-Object { | |
pip install $_.FullName | |
} | |
pytest python/tests | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifact | |
path: ./wheelhouse/*.whl | |
build_wheels_linux: | |
name: Build Wheels for Python ${{ matrix.python }} on Ubuntu | |
strategy: | |
fail-fast: false | |
matrix: | |
python: [ "3.9", "3.10", "3.11", "3.12" ] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
- name: Set up Clang 15 | |
env: | |
LLVM_VERSION: 15 | |
run: | | |
sudo apt-get update -y -q | |
sudo apt-get install -y -q lsb-release wget software-properties-common gnupg | |
sudo wget https://apt.llvm.org/llvm.sh | |
sudo chmod +x llvm.sh | |
sudo ./llvm.sh ${LLVM_VERSION} | |
sudo apt-get install -y -q libc++-${LLVM_VERSION}-dev libc++abi-${LLVM_VERSION}-dev | |
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-${LLVM_VERSION} 100 | |
- name: Set up CMake and Ninja | |
uses: lukka/get-cmake@latest | |
- name: Set up Conan | |
run: | | |
python -m pip install -U pip | |
pip install conan | |
conan profile detect --force | |
conan export third_party/funchook --version 1.1.3 | |
conan install . --build=missing -pr:a .github/conan_profiles/linux | |
- name: Build Wheels | |
run: | | |
python -m pip install -U pip | |
pip install wheel | |
python -m pip wheel . --no-deps --wheel-dir=wheelhouse --verbose | |
- name: Repair Wheels | |
run: | | |
pip install auditwheel setuptools "patchelf>=0.14" | |
python -m auditwheel --verbose repair --plat manylinux_2_31_x86_64 -w wheelhouse wheelhouse/*.whl | |
- name: Test Wheels | |
run: | | |
pip install pytest | |
pip install wheelhouse/*.whl | |
pytest python/tests | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifact | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build Source Distribution | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifact | |
path: dist/*.tar.gz | |
publish: | |
name: Publish Wheels to PyPI | |
if: github.event_name == 'release' && github.event.action == 'published' | |
runs-on: ubuntu-latest | |
needs: [ build_wheels_windows, build_wheels_linux, build_sdist ] | |
environment: pypi | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- name: Restore Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |