From c21ab4316cc82f3b2ee195e8f3bedfb7350981e8 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Mon, 15 Aug 2022 06:47:36 +0300 Subject: [PATCH] Fix publish of pip package to PyPi on git tag --- .github/workflows/publish.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d9c50d91..1f36d0b8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,14 +1,16 @@ name: publish on: - pull_request: + push: + tags: + - v* branches: - 'master' paths: - src/** - setup.py - .github/workflows/publish.yml - push: + pull_request: branches: - 'master' paths: @@ -38,7 +40,7 @@ jobs: pip install --upgrade . - name: Publish Release to PyPI - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: startsWith(github.ref, 'refs/tags') env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }}