Skip to content

Fix Sphinx roles in README that fail twine check (and gate it in PR CI) #124

Fix Sphinx roles in README that fail twine check (and gate it in PR CI)

Fix Sphinx roles in README that fail twine check (and gate it in PR CI) #124

name: Build and upload to PyPI
on:
pull_request:
push:
tags:
- v*
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest, macos-15-intel]
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: pypa/cibuildwheel@v3.3.0
- uses: actions/upload-artifact@v6
with:
name: pyacvd-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build and test source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
cache: pip
- name: Set up headless display
uses: pyvista/setup-headless-display-action@v4
- name: Build sdist
run: pipx run build --sdist
- name: Verify README renders on PyPI (twine check)
run: pipx run twine check --strict dist/*.tar.gz
- name: Install sdist
run: pip install dist/*.tar.gz
- name: Unit testing
run: |
pip install pytest
pytest
- uses: actions/upload-artifact@v6
with:
name: pyacvd-sdist
path: dist/*.tar.gz
release:
name: Release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyacvd
permissions:
id-token: write # this permission is mandatory for trusted publishing
contents: write # required to create a release
steps:
- uses: actions/download-artifact@v7
with:
pattern: pyacvd-*
path: dist
merge-multiple: true
- run: ls -alR dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
./dist/*.whl