Skip to content

[pre-commit.ci] pre-commit autoupdate #243

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #243

name: Publish Python distributions to PyPI
on: [push, pull_request]
jobs:
build-n-publish:
name: Build and publish to PyPI and TestPyPI
runs-on: ubuntu-latest
env:
PYTHON: 3.9
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Set up Python ${{ env.PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON }}
- name: Install package
run: |
python -m pip install --upgrade pip
python -m pip install .[package]
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish to PyPI
if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}