From 47a4c153ebdaa837d880635b5b06fef6e28f87b4 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Thu, 24 Jul 2025 17:00:21 -0700 Subject: [PATCH] fix: enable PyPI publish on tag push - Manual Release workflow creates tags but build-and-publish.yml only published on 'release' events - Now build-and-publish.yml will also publish when v* tags are pushed - This fixes the issue where manual releases didn't trigger PyPI uploads --- .github/workflows/build-and-publish.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index dd1a5d7..3d264b9 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -226,7 +226,7 @@ jobs: name: Publish to PyPI needs: [build-core, build-hnsw, build-diskann, build-meta] runs-on: ubuntu-latest - if: github.event_name == 'release' || github.event.inputs.publish != 'false' + if: github.event_name == 'release' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) steps: - name: Download all artifacts @@ -240,17 +240,14 @@ jobs: find dist -name "*.whl" -exec cp {} all_wheels/ \; find dist -name "*.tar.gz" -exec cp {} all_wheels/ \; - - name: Publish to Test PyPI - if: github.event.inputs.publish == 'test' || github.event_name == 'workflow_dispatch' - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ - packages-dir: all_wheels/ + - name: Show what will be published + run: | + echo "📦 Packages to be published:" + ls -la all_wheels/ - name: Publish to PyPI - if: github.event_name == 'release' || github.event.inputs.publish == 'prod' uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} - packages-dir: all_wheels/ \ No newline at end of file + packages-dir: all_wheels/ + skip-existing: true \ No newline at end of file