Skip to content

CyRK v0.11.4

CyRK v0.11.4 #40

name: Build Wheels for PyPI
on:
workflow_dispatch:
release:
types:
- published
jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true # Optional, use if you have submodules
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: artifact_sdist
build_macos_latest_wheel:
name: Build MacOS (latest) wheel for Python ${{ matrix.python }}
runs-on: macos-latest
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- name: Checkout CyRK
uses: actions/checkout@v4
- name: Install Anaconda
uses: conda-incubator/setup-miniconda@main
with:
activate-environment: cyrk_macos_latest_wheels
auto-update-conda: true
python-version: ${{ matrix.python }}
auto-activate-base: false
- name: Conda info
shell: bash -el {0}
run: conda info
- name: install llvm # openMP does not play nice with clang on MacOS; also some versions of macos use older gcc so there is a need to install latest.
shell: bash -el {0}
run: |
brew install llvm libomp
- name: Install package
shell: bash -el {0}
run: |
python -m pip install --upgrade build
conda install pytest matplotlib numba numpy scipy cython pytest-xdist
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
python -m build --wheel --outdir ./wheelhouse/
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: artifact_MacosLatest_${{ matrix.python }}_whl
build_macos_13_wheel:
name: Build MacOS-13 (x64-86) wheel for Python ${{ matrix.python }}
runs-on: macos-13
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- name: Checkout CyRK
uses: actions/checkout@v4
- name: Install Anaconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: cyrk_macos_13_wheels
auto-update-conda: true
python-version: ${{ matrix.python }}
auto-activate-base: false
- name: Conda info
shell: bash -el {0}
run: conda info
- name: install llvm # openMP does not play nice with clang on MacOS; also some versions of macos use older gcc so there is a need to install latest.
shell: bash -el {0}
run: |
brew install llvm libomp
- name: Install package
shell: bash -el {0}
run: |
python -m pip install --upgrade build
conda install nomkl
conda install pytest matplotlib numba numpy scipy cython pytest-xdist
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export LDFLAGS="-L/usr/local/opt/libomp/lib"
export CPPFLAGS="-I/usr/local/opt/libomp/include"
export CC=/usr/local/opt/llvm/bin/clang
export CXX=/usr/local/opt/llvm/bin/clang++
python -m build --wheel --outdir ./wheelhouse/
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: artifact_Macos13_${{ matrix.python }}_whl
build_other_wheels:
name: Build ${{ matrix.platform }} wheels
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
# - macos-12 ## macos is not playing nice with cibuildwheel with openmp from cython.
- windows-latest
- ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build wheels
uses: pypa/cibuildwheel@main
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: artifact_${{ matrix.platform }}_whls
check_dist:
name: Check sdist
needs: [make_sdist, build_macos_latest_wheel, build_macos_13_wheel, build_other_wheels]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
name: artifact_sdist
path: sdist
- run: pipx run twine check --strict sdist/*
upload_all:
name: Upload wheels to PyPI
needs: [build_macos_latest_wheel, build_macos_13_wheel, build_other_wheels, make_sdist, check_dist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}