From 1215000589af4196eb7da82354ab114bf4dc6a81 Mon Sep 17 00:00:00 2001 From: Attila Szakacs Date: Fri, 3 Jun 2022 14:17:37 +0200 Subject: [PATCH] github-actions: add choice input to release workflow Signed-off-by: Attila Szakacs --- .github/workflows/release.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e3efd2..7a3383d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,9 +3,14 @@ name: Release on: workflow_dispatch: inputs: - is_test_release: - description: "is_test_release (true/false): If set to true, uploads to test.pypi.org and does not create a GitHub Release." + is-stable-release: + description: "is-stable-release: If set to false, uploads to test.pypi.org and does not create a GitHub Release." required: true + type: choice + options: + - "true" + - "false" + default: "false" jobs: release: @@ -41,17 +46,17 @@ jobs: pytest --import-mode=importlib - name: upload package (test.pypi.org) - if: github.event.inputs.is_test_release == 'true' + if: github.event.inputs.is-stable-release == 'false' run: | twine upload -r testpypi dist/* -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }} - name: upload package (pypi.org) - if: github.event.inputs.is_test_release == 'false' + if: github.event.inputs.is-stable-release == 'true' run: | twine upload dist/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} - name: Publish GitHub Release - if: github.event.inputs.is_test_release == 'false' + if: github.event.inputs.is-stable-release == 'true' run: | VERSION=$(cat VERSION | tr -d "\n") echo ${VERSION} > /tmp/message