Skip to content

Upload Python Package #2

Upload Python Package

Upload Python Package #2

Workflow file for this run

# Upload to PyPI when a GitHub release is published.
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
name: Upload Python Package
on:
release:
types: [published]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
ref: ${{ github.event.release.tag_name }}
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build==1.5.0
- name: Build package
run: python -m build
- name: Publish package
# pypa/gh-action-pypi-publish@v1.12.4
uses: pypa/gh-action-pypi-publish@7f25271a4aa483500f742f9492b2ab5648d61011
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}