From cc1a88f586af7824790bc3ba76be3e9837e19b53 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Thu, 5 Sep 2024 23:30:44 -0400 Subject: [PATCH] Update publish-to-pypi.yml --- .github/workflows/publish-to-pypi.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 608bd78..f3d35fd 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -5,6 +5,11 @@ on: workflows: ["Run Tests"] types: - completed + push: + tags: + - 'v*.*.*' # Trigger the workflow for version tags like 'v1.0.0' + release: + types: [published] # Trigger the workflow when a release is published jobs: test-installation: @@ -63,7 +68,6 @@ jobs: run: echo ${{ github.ref }} - name: Publish distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }}