File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish to PyPI
2
+
3
+ on :
4
+ release :
5
+ types : [created]
6
+
7
+ jobs :
8
+ deploy :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - uses : actions/checkout@v3
12
+
13
+ - name : Set up Python
14
+ uses : actions/setup-python@v4
15
+ with :
16
+ python-version : ' 3.10'
17
+
18
+ - name : Install dependencies
19
+ run : |
20
+ python -m pip install --upgrade pip
21
+ pip install build twine
22
+
23
+ - name : Extract version from tag
24
+ id : get_version
25
+ run : echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
26
+
27
+ - name : Update version in files
28
+ run : |
29
+ # Update pyproject.toml version
30
+ sed -i "s/^version = .*/version = \"${{ env.VERSION }}\"/" pyproject.toml
31
+
32
+ # Update __init__.py version
33
+ sed -i "s/__version__ = .*/__version__ = \"${{ env.VERSION }}\"/" src/code_index_mcp/__init__.py
34
+
35
+ - name : Build package
36
+ run : python -m build
37
+
38
+ - name : Check package
39
+ run : twine check dist/*
40
+
41
+ - name : Publish to PyPI
42
+ uses : pypa/gh-action-pypi-publish@release/v1
43
+ with :
44
+ password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments