Skip to content

Commit

Permalink
github-actions: add choice input to release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Szakacs <attila.szakacs@oneidentity.com>
  • Loading branch information
alltilla committed Jun 3, 2022
1 parent b32d030 commit 1215000
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1215000

Please sign in to comment.