Skip to content

Commit

Permalink
fix: pypi publish running unconditionally (#1182)
Browse files Browse the repository at this point in the history
Ported from CQCL/tket2#394

The if condition that decided whether to publish to pypi always evaluate
to true -.-

Passing (skipped) CI:
https://github.com/CQCL/hugr/actions/runs/9419287281/job/25948715096
  • Loading branch information
aborgna-q authored Jun 7, 2024
1 parent bb75522 commit 10a8c17
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/python-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand All @@ -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 }}
Expand Down

0 comments on commit 10a8c17

Please sign in to comment.