chore: add workflow to publish package to PyPI on release

This commit is contained in:
sankalp committed 2025-11-28 02:01:09 +05:45
1 parent 2e563fd8bb
commit b5362ade00
1 file changed
+28
+28
View File
@@ -0,0 +1,28 @@
name: Publish to PyPI
on:
release:
types: [published]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish package to PyPI
run: python -m twine upload dist/* --verbose