Skip to content

Commit 8580241

Browse files
RodriguespnPedro Rodrigues
andauthored
Github action to update package version on GitHub action (#16)
* remove the yml files from .gitignore * publish package on pypi on push * global package version variable --------- Co-authored-by: Pedro Rodrigues <prodrigues@Pedros-MacBook-Pro.local>
1 parent fd4e02c commit 8580241

File tree

5 files changed

+44
-7
lines changed

5 files changed

+44
-7
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Python Package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch: # Allows manual triggering
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
environment: release
13+
permissions:
14+
id-token: write # OIDC authentication with PyPI
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build twine
28+
pip install -r requirements.txt
29+
30+
- name: Build package
31+
run: python -m build
32+
33+
- name: Publish package to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1
35+
with:
36+
password: ${{ secrets.PYPI_API_KEY }}

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,4 @@ dmypy.json
4949

5050
# Tool specific
5151
tool_result.txt
52-
.DS_Store
53-
54-
*.yml
55-
*.yaml
52+
.DS_Store

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "singlestore_mcp_server"
3-
version = "0.1.1"
3+
dynamic = ["version"]
44
description = "SingleStore MCP server"
55
readme = "README.md"
66
requires-python = ">=3.11"
@@ -10,9 +10,12 @@ dependencies = [
1010
]
1111

1212
[build-system]
13-
requires = [ "hatchling",]
13+
requires = ["hatchling"]
1414
build-backend = "hatchling.build"
1515

16+
[tool.hatch.version]
17+
path = "src/server/version.py"
18+
1619
[tool.hatch.build.targets.wheel]
1720
packages = ["src/server"]
1821

src/server/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async def main():
119119
write_stream,
120120
InitializationOptions(
121121
server_name="SingleStore MCP Server",
122-
server_version="0.1.0",
122+
server_version="0.1.2",
123123
capabilities=server.get_capabilities(
124124
notification_options=NotificationOptions(),
125125
experimental_capabilities={},

src/server/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.1.2"

0 commit comments

Comments
 (0)