Skip to content

Workflow file for this run

name: Build and upload to PyPI
on:
release:
types: [published]
jobs:
upload_pypi:
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential git pkg-config libhdf5-dev -y
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build sdist
run: pipx run build --sdist
- uses: pypa/gh-action-pypi-publish@release/v1