Skip to content

Publish to PyPI

Publish to PyPI #17

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [created]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
# python -m pip install --upgrade pip
pip install hatch
- name: Build package
run: hatch build
- name: Test package
run: hatch -e test run nose2 --verbose
- name: Publish package distributions to Test PyPI
env:
HATCH_INDEX_USER: __token__ # Use '__token__' as the username
HATCH_INDEX_AUTH: ${{ secrets.PYPI_APIKEY }} # PyPI API token stored as a secret
run: |
hatch build
hatch publish