Skip to content

Publish Python 🐍 distributions 📦 to PyPI #9

Publish Python 🐍 distributions 📦 to PyPI

Publish Python 🐍 distributions 📦 to PyPI #9

Workflow file for this run

name: Publish Python 🐍 distributions 📦 to PyPI
# Run when a new release is created on GitHub
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
release:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
# retrieve your distributions here
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: >-
python -m pip install build --user
- name: Build
run: >-
python -m build --sdist --outdir dist/ .
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1