From c9b067eadfbb802fcecb2ecc9449d1bb29f758b8 Mon Sep 17 00:00:00 2001 From: Agustin Borgna Date: Fri, 7 Jun 2024 16:14:13 +0100 Subject: [PATCH] fix: pypi publish running unconditionally --- .github/workflows/python-wheels.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 9b3777991..d8cfe83a6 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -53,9 +53,7 @@ jobs: dist/*.whl - name: Publish to test instance of PyPI (dry-run) - if: | - ${{ github.event_name == 'push' && github.ref_type == 'branch' }} || - ${{ github.event_name == 'workflow_dispatch' && github.ref_type == 'branch'}} + if: ${{ (github.event_name == 'push' && github.ref_type == 'branch') || (github.event_name == 'workflow_dispatch' && github.ref_type == 'branch' ) }} run: | echo "Doing a dry-run publish to test-pypi..." echo "Based on the following workflow variables, this is not a hugr-py version tag push:" @@ -68,9 +66,7 @@ jobs: poetry publish -r test-pypi --dist-dir ../dist --skip-existing --dry-run - name: Publish to PyPI - if: | - ${{ (github.event_name == 'release' && github.ref_type == 'tag' && startsWith(github.ref, format('refs/tags/{0}-v', matrix.package)))}} || - ${{ (github.event_name == 'workflow_dispatch' && github.ref_type == 'tag' && startsWith(github.ref, format('refs/tags/{0}-v', matrix.package)))}} || + if: ${{ (github.event_name == 'release' && github.ref_type == 'tag' && startsWith(github.ref, format('refs/tags/{0}-v', matrix.package)) ) || (github.event_name == 'workflow_dispatch' && github.ref_type == 'tag' && startsWith(github.ref, format('refs/tags/{0}-v', matrix.package)) ) }} run: | cd ${{ matrix.package }} poetry config pypi-token.pypi ${{ secrets.PYPI_PUBLISH }}