Skip to content

1.9.5

1.9.5 #11

name: Build Wheel and Publish for Releases
on:
workflow_dispatch:
release:
types: [published]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025, macos-15-intel, macos-15]
steps:
- uses: actions/checkout@v6
- run: |
git fetch --prune --unshallow
- name: Build wheels
uses: pypa/cibuildwheel@v3.3.0
- uses: actions/upload-artifact@v6
with:
name: artifact-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
git fetch --prune --unshallow
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v6
with:
name: artifact-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v6
with:
pattern: artifact-*
path: dist
merge-multiple: true
- name: Check dist
run: ls dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# To test: repository_url: https://test.pypi.org/legacy/