[pre-commit.ci] pre-commit autoupdate #243
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |