Skip to content

update/docs

update/docs #56

name: Publish to PyPI and TestPyPI
on:
push:
paths:
- 'CHANGELOG.txt' # Only run when CHANGELOG.txt changes
release:
types: [published] # Run when a GitHub Release is published
jobs:
build-and-publish-testpypi:
if: github.event_name == 'push'
name: Build and publish to TestPyPI (on setup.py change)
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11.9
uses: actions/setup-python@v4
with:
python-version: '3.11.9'
- name: Install build tool
run: python -m pip install --upgrade pip build
- name: Build sdist and wheel
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
user: __token__
verbose: 'true'
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
skip-existing: true
build-and-publish-pypi:
if: github.event_name == 'release' && github.event.action == 'published'
name: Build and publish to PyPI (on Release)
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11.9
uses: actions/setup-python@v4
with:
python-version: '3.11.9'
- name: Install build tool
run: python -m pip install --upgrade pip build
- name: Build sdist and wheel
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository-url: https://upload.pypi.org/legacy/
skip-existing: true
verbose: true