Skip to content

Merge pull request #18 from hiddenSymmetries/scikit #140

Merge pull request #18 from hiddenSymmetries/scikit

Merge pull request #18 from hiddenSymmetries/scikit #140

Workflow file for this run

name: Wheel Builder
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.runner }} #(${{ runner.arch }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest # x86_64
arch_flag: "-march=ivybridge"
- runner: macos-14 # arm64
deployment_target: 14
arch_flag: "-mcpu=apple-m1"
- runner: macos-15 # arm64
deployment_target: 15
arch_flag: "-mcpu=apple-m1"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS_LINUX: x86_64
CIBW_ENVIRONMENT_LINUX: CI=True VC_ARCH_FLAG=${{ matrix.arch_flag }}
CIBW_BEFORE_ALL_LINUX: yum install -y lapack-devel openblas-devel fftw-devel
CIBW_BEFORE_BUILD_LINUX: python -m pip install --upgrade pip setuptools wheel numpy cmake ninja && git config --global --add safe.directory /project
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
CIBW_SKIP: "*-musllinux_*"
CIBW_ENVIRONMENT_MACOS: CI=True VC_ARCH_FLAG=${{ matrix.arch_flag }} MACOSX_DEPLOYMENT_TARGET=${{ matrix.deployment_target }} CC=gcc-12 CXX=g++-12 # with GCC
#CIBW_ENVIRONMENT_MACOS: CI=True VC_ARCH_FLAG=${{ matrix.arch_flat }} MACOSX_DEPLOYMENT_TARGET=${{ matrix.deployment_target }} OpenMP_ROOT=$(brew --prefix)/opt/libomp # with Apple Clang
CIBW_BEFORE_ALL_MACOS: brew install fftw lapack gcc@12 libomp openblas
CIBW_BEFORE_BUILD_MACOS: python -m pip install --upgrade pip setuptools wheel numpy cmake ninja && git config --global --add safe.directory /project
CIBW_BUILD: cp310-* cp311-* cp312-* cp313-*
- name: Debug with tmate on failure
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
with:
timeout-minutes: 15
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.runner }}
path: wheelhouse/*.whl
overwrite: true
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.11'
# - name: Install setuptools_scm
# run: python -m pip install setuptools_scm
- name: Build sdist
run: |
pip install build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
overwrite: true
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
# password: ${{ secrets.PYPI_TOKEN }}
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/