diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index c6826261..9e569e03 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,7 +1,19 @@ name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI -on: push - +on: + # Trigger the workflow on push , PR or release publish, + # but only for the main branch + push: + branches: + - master + pull_request: + branches: + - master + release: + types: + - published + - released + jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI @@ -15,13 +27,13 @@ jobs: - name: Build package run: python setup.py sdist - name: Publish distribution 📦 to Test PyPI + if: github.event_name == 'push' uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ - name: Publish distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags') + if: github.event_name == 'release' uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.PYPI_API_TOKEN }} - \ No newline at end of file diff --git a/polypheny/version.py b/polypheny/version.py index cc136e1c..b8274b68 100644 --- a/polypheny/version.py +++ b/polypheny/version.py @@ -1,3 +1,3 @@ # Update this for the versions # Don't change the forth version number from None -VERSION = (0, 2, 0, None) \ No newline at end of file +VERSION = (0, 2, 0, None)