Skip to content

Publish Python 🐍 distributions 📦 to TestPyPI #20

Publish Python 🐍 distributions 📦 to TestPyPI

Publish Python 🐍 distributions 📦 to TestPyPI #20

# publish a python package to the test pipy registry - await until the generate clients finishes
name: Publish Python 🐍 distributions 📦 to TestPyPI
#-----------------------------------------------------------------------------------
# Push to TestPyPI unconditionally (need to rev version, del/yank ver will not work)
#
# For testing use:
# on: push
# (push to the TestPyPi registry on every push during development)
#
# Once test is completed use:
# on:
# workflow_run:
# workflows: [Generate OpenAPI Clients] -> old ['generate-eMASS-clients']
# types:
# - completed
#-----------------------------------------------------------------------------------
on:
workflow_run:
workflows: [Generate OpenAPI Clients]
types:
- completed
# on: push
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
cd src/python_client
python -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: src/python_client/dist/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/