Skip to content

v3.0.0

v3.0.0 #31

Workflow file for this run

name: Publish
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build twine
- name: Build SDist
run: python -m build --sdist
- name: Check metadata
run: python -m twine check dist/*
- name: Test
run: |
python -m pip install dist/*.tar.gz pytest requests
pytest test/ --ignore test/test_ros.py --color=yes -v
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels:
name: ${{ matrix.platform[0] }} - ${{ matrix.platform[2] }}
runs-on: ${{ matrix.platform[1] }}
strategy:
fail-fast: false
matrix:
platform:
# Build only for 64-bit platforms that have binaries for NumPy
- [Linux, ubuntu-latest, x86_64]
# - [Linux, ubuntu-latest, i686]
- [Linux, ubuntu-latest, aarch64]
# - [Linux, ubuntu-latest, ppc64le]
# - [Linux, ubuntu-latest, s390x]
- [Windows, windows-latest, AMD64]
# - [Windows, windows-latest, x86]
# - [Windows, windows-latest, ARM64]
- [MacOS, macos-latest, x86_64]
- [MacOS, macos-latest, arm64]
# - [MacOS, macos-latest, universal2]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Download test data
run: |
python -m pip install pytest requests
python -m pytest test --color=yes || true
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: ${{ matrix.platform[2] }}
# Needed for C++17 support on macOS
MACOSX_DEPLOYMENT_TARGET: 10.14
- name: Inspect
run: ls wheelhouse/
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
upload_all:
name: Upload if release
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}