Skip to content

Commit

Permalink
publish on PyPI when a release created
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu-g committed Oct 29, 2022
1 parent 7754c3e commit 7861445
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Publish

on:
workflow_run:
workflows: [ "test" ]
types: [ completed ]
branches: [ main ]
release:
types: [ published ]

jobs:
build-publish:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
Expand All @@ -26,8 +23,6 @@ jobs:
run: poetry build

- name: Publish package
# upload packages only on a tagged commit
if: github.event_name == 'workflow_run' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
Expand Down

0 comments on commit 7861445

Please sign in to comment.