Skip to content

Bump cibuildwheel and fix macos build #20

Bump cibuildwheel and fix macos build

Bump cibuildwheel and fix macos build #20

name: Build and upload
on:
pull_request:
push:
tags:
- "*"
branches:
- "main"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-14, macos-13]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: pyminiply-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build sdist
run: pipx run build --sdist
- name: Validate wheel
run: |
pip install twine
twine check dist/*
- name: Validate sdist
run: |
pip install dist/*
pip install pytest pyvista
pytest
- uses: actions/upload-artifact@v4
with:
name: pyminiply-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
- name: Flatten directory structure
run: |
mkdir -p dist/
find . -name '*.whl' -exec mv {} dist/ \;
find . -name '*.tar.gz' -exec mv {} dist/ \;
- name: List artifacts
run: ls -R
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
./dist/*.whl