Skip to content

Workflow file for this run

name: Publish to TestPyPI and PyPI
on:
workflow_dispatch:
release:
types: [published]
jobs:
publish-test-pypi:
name: Build and publish to TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build
run: |
echo "Building ..."
python -m pip install --upgrade pip
python -m pip install build
python -m build
- name: Publish to TestPyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}