Skip to content

Test and Publish to PyPI #5

Test and Publish to PyPI

Test and Publish to PyPI #5

Workflow file for this run

name: Test and Publish to PyPI
on:
push:
tags: ['v*.*.*']
jobs:
test:
uses: ./.github/workflows/test.yml
with:
python-versions: '["3.11", "3.12"]' # Only test recent versions for releases
run-linting: true
test-build: false
publish:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*