Skip to content

Commit

Permalink
Add auto publish
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmcalpine committed Sep 2, 2024
1 parent 282bc22 commit 9325b91
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Python Package to PyPI

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out the code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build the package
run: |
python3 -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload -r testpypi dist/*
- name: Clean up
run: |
rm -rf dist build *.egg-info

0 comments on commit 9325b91

Please sign in to comment.