diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml new file mode 100644 index 0000000..caad271 --- /dev/null +++ b/.github/workflows/pypi.yaml @@ -0,0 +1,36 @@ +name: Release - Publish to PyPI + +on: + push: + tags: + - "v*" + +jobs: + publish: + name: Build and Publish Package + runs-on: ubuntu-latest + + steps: + - name: Repository Checkout + uses: actions/checkout@v4 + + - name: Setup Python Environment + uses: actions/setup-python@v5 + with: + python-version: "3.13" + cache: "pip" + + - name: Install Build Tools + run: | + python -m pip install --upgrade build twine + + - name: Build Distribution Package + run: python -m build + + - name: Validate Package Metadata + run: twine check dist/* + + - name: Upload to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }}