Updates for automated pypi publishing

This commit is contained in:
Darren Eberly
2022-08-11 00:23:06 -04:00
parent 51406226de
commit 2950b1a86f
2 changed files with 31 additions and 1 deletions

30
.github/workflows/publish-to-pypi.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Publish Python distribution to PyPI and TestPyPI
on: push
jobs:
build-n-publish:
name: Build and public Python distribution to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m pip install --user ".[build]"
- name: Build a binary wheel and a source tarball
run: >-
python -m build --sdist --wheel --outdir dist/
- name: Publish Distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TESTPYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish Distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-public@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

View File

@@ -50,7 +50,7 @@ tests =
isort<5,>=4.2.5
build =
pep517
build
docs =
sphinx