Skip to content

Workflow file for this run

name: Build, test and deploy to PyPI
on:
workflow_dispatch:
release:
types:
- published
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: wheels-${{ matrix.os }}-${{ strategy.job-index }}
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: wheels-sdist
upload_pypi:
name: Upload to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/opticalmapping
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: wheels-*
path: dist
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1