diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index ff36a00..6341d9e 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -1,12 +1,17 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI -on: push +on: + workflow_run: + workflows: ['Tests'] + types: [completed] jobs: build: name: Build distribution 📦 runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')}} + steps: - uses: actions/checkout@v4 with: @@ -34,7 +39,7 @@ jobs: publish-to-pypi: name: >- Publish Python 🐍 distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + if: startsWith(github.ref, 'refs/tags/v') # only publish to PyPI on tag pushes, of tags whose names start with 'v' needs: - build runs-on: ubuntu-latest diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 808170f..6d69861 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -1,9 +1,7 @@ -name: tests +name: Tests on: workflow_dispatch: push: - branches: ["master"] - tags-ignore: ["**"] pull_request: concurrency: