Skip to content

Commit ba230fc

Browse files
committed
Add workflow for automated release to PyPI
1 parent b1e0e3d commit ba230fc

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
8+
jobs:
9+
build-and-release:
10+
name: Build and Release
11+
runs-on: ubuntu-20.04
12+
timeout-minutes: 5
13+
steps:
14+
- name: Set Up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.12'
18+
- name: Check out code
19+
uses: actions/checkout@v4
20+
- name: Install build dependencies
21+
run: pip install build twine
22+
- name: Build package
23+
run: python -m build .
24+
- name: Twine Check
25+
run: twine check dist/*
26+
- name: Publish to PyPI
27+
env:
28+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
29+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
30+
run: twine upload dist/*

0 commit comments

Comments
 (0)