Skip to content

Publish Python 🐍 distribution πŸ“¦ to PyPI #9

Publish Python 🐍 distribution πŸ“¦ to PyPI

Publish Python 🐍 distribution πŸ“¦ to PyPI #9

Workflow file for this run

name: Publish Python 🐍 distribution πŸ“¦ to PyPI
on:
workflow_run:
workflows: ["CI"]
types:
- completed
branches:
- main
release:
types: [published]
jobs:
build-and-publish:
if: >
github.event_name == 'release' &&
github.event.action == 'published' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# No password needed! Uses OIDC trusted publisher