Skip to content

Commit

Permalink
Add workflow to automatically publish to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessel Bruinsma committed Jul 25, 2024
1 parent ca57d7b commit 05c8f37
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to PyPI

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Make sure tags are fetched, so we can get a version.
- run: |
git fetch --prune --unshallow --tags
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

run: |
python -m build
twine upload dist/*

0 comments on commit 05c8f37

Please sign in to comment.