diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 536fbb6..b845ce1 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,11 +1,20 @@ --- name: Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to TestPyPI -on: push +# We want to trigger on push (to deploy to TestPyPI) and on releases (to deploy to PyPI) +on: + push: + branches: + - main + tags: + - 'v*' # Push events to matching v* + release: + types: + - created jobs: build: - name: Build distribution ๐Ÿ“ฆ + name: Build ๐Ÿ“ฆ runs-on: ubuntu-latest steps: @@ -28,7 +37,7 @@ jobs: path: dist/ publish-to-pypi: - name: Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to PyPI + name: "PyPI: Publish ๐Ÿš€" if: startsWith(github.ref, 'refs/tags/v') # only publish to PyPI pushes of tags that start with 'v' needs: - build @@ -49,7 +58,7 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 publish-to-testpypi: - name: Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to TestPyPI + name: "TestPyPi: Publish ๐Ÿงช" needs: - build runs-on: ubuntu-latest