feat: Add GitHub Actions workflow for testing and publishing to PyPI
All checks were successful
Test and Publish / test (3.13) (push) Successful in 12s
Test and Publish / build (push) Has been skipped

This commit is contained in:
Jacob Schmidt 2025-04-16 19:24:27 -05:00
parent aa144c1349
commit 83c50e3f4e

View File

@ -0,0 +1,57 @@
name: Test and Publish
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [published]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.13]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -e .
build:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build setuptools twine wheel
- name: Build package
run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*