Skip to content

Commit

Permalink
Publish prereleases to staging PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
dfunckt committed May 23, 2021
1 parent bc427ed commit 5596151
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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__'
Expand Down

0 comments on commit 5596151

Please sign in to comment.