Skip to content

Not quite ground-up rewrite to use polyfit #91

Not quite ground-up rewrite to use polyfit

Not quite ground-up rewrite to use polyfit #91

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
-DCMAKE_SHARED_LINKER_FLAGS=\"-static-libgcc -static-libstdc++\"
jobs:
build_wheels:
strategy:
matrix:
include:
- os: ubuntu-22.04
cmake_args: "-DBAOBZI_CPU_DISPATCH=on"
cibw_archs: "x86_64"
- os: macos-14
cmake_args: "-DBAOBZI_CPU_DISPATCH=off"
cibw_archs: "universal2"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Build shared objects with CMake
run: |
cmake -B build -S . ${COMMON_CMAKE_ARGS} ${{ matrix.cmake_args }}
cmake --build build --config Release --parallel
cp build/*.{so,dylib,dll} src/python/baobzi/ 2>/dev/null || true
- name: Build wheel
run: 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 }}