Skip to content

Commit 595d6fd

Browse files
change publish to run only if passed test
1 parent b5f737d commit 595d6fd

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish
2+
3+
on:
4+
workflow_run:
5+
workflows: ["CI"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
publish:
11+
name: Publish to pypi if tagged
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-python@v2
16+
- uses: casperdcl/deploy-pypi@v2
17+
with:
18+
password: ${{ secrets.PYPI_API_TOKEN }}
19+
pip: wheel -w dist/ --no-deps .
20+
# only upload if a tag is pushed (otherwise just build & check)
21+
upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}

0 commit comments

Comments
 (0)