Skip to content

Replace unsupported macos-12 to macos-latest in wheel.yml #79

Replace unsupported macos-12 to macos-latest in wheel.yml

Replace unsupported macos-12 to macos-latest in wheel.yml #79

Workflow file for this run

name: Wheel Builder
on: [push, pull_request]
jobs:
linux_wheels:
name: Build wheels on ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# - name: Fetch all history for all tags
# run: git fetch --prune --unshallow
- name: Build wheels
uses: joerick/cibuildwheel@v1.9.0
# to supply options, put them in 'env', like:
env:
# Only build for python 3.{7,8,9}
CIBW_BUILD : cp38-* cp39-* cp310-* cp311-*
CIBW_ENVIRONMENT: CI=True
# Supports only x86_64 arch for linux
CIBW_ARCHS_LINUX: x86_64
CIBW_BEFORE_ALL_LINUX: yum install -y lapack-devel openblas-devel fftw-devel
# Use manylinux2014
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
CIBW_SKIP: cp27-*
CIBW_DEPENDENCY_VERSIONS: latest
CIBW_BEFORE_BUILD_LINUX: pip install --upgrade pip setuptools wheel numpy cmake ninja && git config --global --add safe.directory /project
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
overwrite: true
# Alternate setup for mac_wheel because cibuildwheel is failing for mac
mac_wheels:
name: Build wheels on mac
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [3.8, 3.9, "3.10", "3.11"]
os: [macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install system dependencies
run: |
brew install fftw lapack # gcc@12 libomp openblas
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install wheel builder packages
run: python -m pip install setuptools wheel delocate numpy ninja
- name: Build and repair wheels
run: |
export CC=gcc-12
export CXX=g++-12
python -m pip wheel -w wheel --no-deps .
python --version
delocate-wheel --require-archs x86_64 -w ./wheelhouse ./wheel/*.whl
ls wheel
ls wheelhouse
- name: Debug with tmate on failure
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
overwrite: true
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# - name: Fetch all history for all tags
# run: git fetch --prune --unshallow
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
# - name: Download all submodules
# run: git submodule update --init
# - name: Install setuptools_scm
# run: python -m pip install setuptools_scm
- name: Build sdist
run: python setup.py sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
overwrite: true
upload_pypi:
needs: [linux_wheels, mac_wheels, build_sdist]
# needs: [linux_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@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
# password: ${{ secrets.PYPI_TOKEN }}
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/