Skip to content

Publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI #25

Publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI

Publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI #25

Workflow file for this run

name: Build and publish to PyPI
on:
release:
types: [published]
jobs:
build:
name: Build wheels for all supported Python versions
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{github.workspace}}/src/pyrad_proc/
steps:
- uses: actions/checkout@v3
- name: Set up Python (for pip/cibuildwheel)
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install build dependencies
run: python -m pip install build cibuildwheel
- name: Build sdist
run: python -m build --sdist --outdir dist
- name: Build wheels with cibuildwheel
run: python -m cibuildwheel --output-dir dist
env:
CIBW_SKIP: "cp27-* cp36-* cp37-* cp38-* cp39-* pp*"
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}