Skip to content

Publish to PyPI

Publish to PyPI #1

Workflow file for this run

name: Publish to PyPI
on:
release:
types:
- published
jobs:
pypi-publish:
name: Build with Hatch and upload to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # Required for OIDC authentication
contents: read # Required to access repository contents
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Hatch
run: pip install hatch
- name: Build package with Hatch
run: hatch build
#- name: Test package
# run: hatch run test
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
# https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment#creating-an-environment