Skip to content

Publish PathML Distribution to PyPI and TestPyPI #24

Publish PathML Distribution to PyPI and TestPyPI

Publish PathML Distribution to PyPI and TestPyPI #24

name: Publish PathML Distribution to PyPI and TestPyPI
on:
workflow_dispatch:
release:
types: [published]
jobs:
build-and-publish:
name: Build and Publish PathML Distribution to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set Up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Build Tool
run: pip install --upgrade build
- name: Build Distribution
run: python -m build --sdist --wheel --outdir dist/
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}