From b79ed26c9b446dc51523e2b0e906429759c2ccce Mon Sep 17 00:00:00 2001 From: Angel Ferran Pousa Date: Mon, 22 Feb 2021 22:53:48 +0100 Subject: [PATCH] Add github action to publish to PyPI --- .github/workflow/publish-to-pypi.yml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflow/publish-to-pypi.yml diff --git a/.github/workflow/publish-to-pypi.yml b/.github/workflow/publish-to-pypi.yml new file mode 100644 index 0000000..bdd8af1 --- /dev/null +++ b/.github/workflow/publish-to-pypi.yml @@ -0,0 +1,35 @@ +name: Publish package to PyPI + +on: + release: + types: [created] + +jobs: + build-n-publish: + name: Build and publish package to PyPI + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@master + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Publish distribution to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }}