diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 5d62cf6..059f99b 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -2,8 +2,18 @@ name: Publish assimp-py to PyPI on: workflow_dispatch: + inputs: + pypi_target: + description: 'Deploy to Production or Test PyPI' + required: true + default: 'production' + type: choice + options: + - production + - test + release: - types: [released] + types: [published] env: CIBW_BUILD: cp3* @@ -182,12 +192,17 @@ jobs: merge-multiple: true path: dist - - uses: pypa/gh-action-pypi-publish@v1.10.3 + - name: Publish to Production PyPI + if: ${{ (github.event_name == 'workflow_dispatch' && inputs.pypi_target == 'production') || (github.event_name == 'release' && !github.event.release.prerelease) }} + uses: pypa/gh-action-pypi-publish@v1.10.3 with: user: __token__ - # Uncomment to publish to production PyPI: - # password: ${{ secrets.pypi_password }} + password: ${{ secrets.PYPI_TOKEN }} - # Uncomment to publish to test PyPI (https://test.pypi.org): - password: ${{ secrets.testpypi_password }} + - name: Publish to Test PyPI + if: ${{ (github.event_name == 'workflow_dispatch' && inputs.pypi_target == 'test') || (github.event_name == 'release' && github.event.release.prerelease) }} + uses: pypa/gh-action-pypi-publish@v1.10.3 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_TOKEN }} repository-url: https://test.pypi.org/legacy/