diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5eeb882..e351865 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,11 +1,8 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - name: Publish Package to PyPi on: release: - types: [created] + types: [released, prereleased] jobs: deploy: @@ -21,10 +18,19 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel + pip install build - name: Build - run: python setup.py sdist bdist_wheel + run: | + python -m build + - name: Publish to PyPI Staging + if: "github.event.release.prerelease" + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: '__token__' + password: ${{ secrets.TEST_PYPI_TOKEN }} + repository_url: https://test.pypi.org/legacy/ - name: Publish to PyPI + if: "!github.event.release.prerelease" uses: pypa/gh-action-pypi-publish@release/v1 with: user: '__token__'