Skip to content
name: Publish Python distributions to TestPyPI
on:
push:
tags:
- "v[0-9]+"
- "v[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+[a-z][0-9]+"
- "v[0-9]+.[0-9]+[a-z][0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+[a-z][0-9]+"
jobs:
build-n-publish:
name: Build and publish Python distributions package to TestPyPI
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/