From 3571db202a9b0ccd97254b291e0b7fb083ec33b4 Mon Sep 17 00:00:00 2001 From: heitorlessa Date: Mon, 25 Jul 2022 13:59:52 +0200 Subject: [PATCH] chore(ci): add conditional to skip pypi release --- .github/workflows/publish.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c2af2f2fae5..9a854ffa094 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,6 +28,11 @@ on: description: "Version to be released in PyPi, Docs, and Lambda Layer, e.g. v1.26.4" default: v1.26.4 required: true + skip_pypi: + description: "Skip publishing to PyPi as it can't publish more than once. Useful for semi-failed releases" + default: false + type: boolean + required: false jobs: release: @@ -74,13 +79,16 @@ jobs: git commit -m "chore(ci): update project with version ${RELEASE_VERSION}" git push origin HEAD:refs/heads/develop - name: Build python package and wheel + if: ${{ !inputs.skip_pypi }} run: poetry build - name: Upload to PyPi test + if: ${{ !inputs.skip_pypi }} run: make release-test env: PYPI_USERNAME: __token__ PYPI_TEST_TOKEN: ${{ secrets.PYPI_TEST_TOKEN }} - name: Upload to PyPi prod + if: ${{ !inputs.skip_pypi }} run: make release-prod env: PYPI_USERNAME: __token__