Skip to content

Commit f16c92e

Browse files
chore: add setup.py and publish workflow for PyPI deployment
1 parent dc8ae23 commit f16c92e

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch: # Manual trigger option
7+
8+
jobs:
9+
pypi-publish:
10+
name: Upload release to PyPI
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/ai-commit-cli
15+
permissions:
16+
id-token: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build twine
29+
30+
- name: Build package
31+
run: python -m build
32+
33+
- name: Check package
34+
run: twine check dist/*
35+
36+
- name: Publish to PyPI
37+
uses: pypa/gh-action-pypi-publish@release/v1
38+
with:
39+
password: ${{ secrets.PYPI_API_TOKEN }}
File renamed without changes.

0 commit comments

Comments
 (0)