Skip to content

Commit

Permalink
add master limitation for push trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
tomshaffner authored Feb 2, 2021
1 parent fdb3f91 commit d4cb1bb
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/publish_to_pypi_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

# Controls when the action will run.
on: push
on:
push:
branches:
- master

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -38,13 +41,15 @@ jobs:
--wheel
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PROD_PYPI_API_TOKEN }}

- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

0 comments on commit d4cb1bb

Please sign in to comment.