Skip to content

Not quite ground-up rewrite to use polyfit #103

Not quite ground-up rewrite to use polyfit

Not quite ground-up rewrite to use polyfit #103

Workflow file for this run

name: Build and upload to PyPI
# Build on every branch push, tag push, and pull request change:
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
env:
COMMON_CMAKE_ARGS: "-DBAOBZI_BUILD_TESTS=OFF -DBAOBZI_BUILD_EXAMPLES=OFF -DBAOBZI_BUILD_FORTRAN=OFF -DCMAKE_BUILD_TYPE=Release"
jobs:
build_wheels:
strategy:
matrix:
include:
- os: ubuntu-latest
cibw_archs: "x86_64"
- os: macos-latest
cibw_archs: "universal2"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Build shared objects and wheel (Linux only)
if: matrix.os == 'ubuntu-latest'
run: |
docker run --rm -e PLAT=manylinux_2_28_x86_64 -v $PWD:/io quay.io/pypa/manylinux_2_28_x86_64 bash -c "
cd /io
cmake -B build -S . ${COMMON_CMAKE_ARGS} -DCMAKE_SHARED_LINKER_FLAGS='-static-libgcc -static-libstdc++' -DBAOBZI_CPU_DISPATCH=on
cmake --build build --config Release --parallel
cp -v build/*.so src/python/baobzi/
/opt/python/cp311-cp311/bin/pip install build
/opt/python/cp311-cp311/bin/python -m build --wheel
"
- name: Build wheel (macOS only)
if: matrix.os == 'macos-latest'
run: |
cmake -B build -S . ${COMMON_CMAKE_ARGS} -DBAOBZI_CPU_DISPATCH=off
cmake --build build --config Release --parallel
cp -v build/*.dylib src/python/baobzi/
pipx run build --wheel
- uses: actions/upload-artifact@v4
with:
name: build_wheels_${{ matrix.os }}
path: ./dist/*.whl
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: build_sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
pattern: build_wheels_*
path: dist
- uses: actions/download-artifact@v4
with:
name: build_sdist
path: dist
- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI }}