From f211eff80c4efeeed60810eab772bf405624c591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Mon, 7 Feb 2022 17:24:46 +0100 Subject: [PATCH] Add workflow for publishing on PyPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nikola Forró --- .github/workflows/pypi-publish.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/pypi-publish.yml diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 0000000..638f6d5 --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,29 @@ +# Upload a Python package when a release is created +# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows + +name: Publish Python 🐍 distributions 📦 to PyPI + +on: + release: + types: [created] + +jobs: + build-n-publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + + - name: Build a source tarball and a binary wheel + # https://pypa-build.readthedocs.io + run: | + python -m pip install build + python -m build --sdist --wheel + + - name: Publish 📦 to PyPI + # https://github.com/pypa/gh-action-pypi-publish + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + verbose: true