From f9d3cff6bc8a21dab2067318f3894d66aea4ad32 Mon Sep 17 00:00:00 2001 From: cbrand Date: Fri, 26 Jan 2024 16:29:19 -0500 Subject: [PATCH] Make pypi publish conditional --- ...lient.yml => python-build-and-publish.yml} | 7 ++++++- .github/workflows/test-pypi-publish.yml | 20 ------------------- 2 files changed, 6 insertions(+), 21 deletions(-) rename .github/workflows/{generate-python-client.yml => python-build-and-publish.yml} (78%) delete mode 100644 .github/workflows/test-pypi-publish.yml diff --git a/.github/workflows/generate-python-client.yml b/.github/workflows/python-build-and-publish.yml similarity index 78% rename from .github/workflows/generate-python-client.yml rename to .github/workflows/python-build-and-publish.yml index a8c5522..36920db 100644 --- a/.github/workflows/generate-python-client.yml +++ b/.github/workflows/python-build-and-publish.yml @@ -33,4 +33,9 @@ jobs: - name: Build with Poetry working-directory: ./python-client run: poetry build - \ No newline at end of file + - name: Publish package distributions to TestPyPI + if: github.ref == 'refs/heads/dev' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + packages-dir: python-client/dist/ \ No newline at end of file diff --git a/.github/workflows/test-pypi-publish.yml b/.github/workflows/test-pypi-publish.yml deleted file mode 100644 index 908ff5d..0000000 --- a/.github/workflows/test-pypi-publish.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Test Pypi Publish - -on: - workflow_run: - workflows: [generate-python-client] - branches: [dev] - types: [completed] - -jobs: - publish: - name: Publish to Test Pypi - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - steps: - - name: Publish package distributions to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - packages-dir: python-client/dist/ - \ No newline at end of file