Skip to content

Publish to Test PyPI #4

Publish to Test PyPI

Publish to Test PyPI #4

name: Publish to Test PyPI
on:
push:
tags:
- 'v*' # Trigger on version tags
workflow_dispatch: # Allow manual trigger
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Check build
run: |
twine check dist/*
- name: Publish to Test PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
run: |
twine upload --skip-existing dist/*