Skip to content

Commit

Permalink
Add tag-based releases to publish to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella committed Dec 18, 2023
1 parent df2cd49 commit 1637f88
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/deploy_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy to PyPI

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
build-and-release:
name: Build and Release
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check out code
uses: actions/checkout@v4
- name: Install build dependencies
run: pip install build twine
- name: Build package
run: python -m build .
- name: Twine Check
run: twine check dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*

0 comments on commit 1637f88

Please sign in to comment.