feat(ci): add workflow to publish package to PyPI on release

This commit is contained in:
sankalp committed 2025-11-26 14:24:26 +05:45
1 parent 201e54b7f9
commit 5efea9b779
3 files changed
+30 -47

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
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 hatch twine
- name: Build package
run: hatch build
- name: Test package
run: hatch run test
- name: Publish package to PyPI
run: python -m twine upload dist/* --verbose