Skip to content

Commit

Permalink
Add gh-action-pypi-publish job
Browse files Browse the repository at this point in the history
  • Loading branch information
miccoli committed Aug 15, 2023
1 parent ee2e6a2 commit 2509bc2
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build package and run test matrix
name: Build package, run test matrix, and publish on PyPi

env:
BUILD_PYTHON_VERSION: "3.7"
Expand Down Expand Up @@ -60,3 +60,23 @@ jobs:
- name: Test with pytest
run: |
pytest
pypi-publish:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/trick17
permissions:
id-token: write
steps:
- name: Download dist
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 2509bc2

Please sign in to comment.