Skip to content

Workflow file for this run

name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
on:
push:
tags:
- 'v*'
permissions:
contents: read
id-token: write
jobs:
build-n-publish:
if: startsWith(github.ref, 'refs/tags/')
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python -m pip install build
- name: Build a binary wheel and a source tarball
run: >-
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true