1111 default : ' false'
1212 type : boolean
1313 version :
14- description : ' Version to publish (e.g., 1.1 .0, required when skip_pypi is true)'
14+ description : ' Version to publish (e.g., 1.2 .0, required when skip_pypi is true)'
1515 required : false
1616 type : string
1717
@@ -25,36 +25,30 @@ jobs:
2525 steps :
2626 - uses : actions/checkout@v4
2727
28- - name : Set up Python ${{ matrix.python-version }}
29- uses : actions /setup-python@v5
28+ - name : Install uv
29+ uses : astral-sh /setup-uv@v4
3030 with :
3131 python-version : ${{ matrix.python-version }}
3232
33- - name : Cache pip dependencies
34- uses : actions/cache@v4
33+ - name : Set up Python ${{ matrix.python-version }}
34+ uses : actions/setup-python@v5
3535 with :
36- path : ~/.cache/pip
37- key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
38- restore-keys : |
39- ${{ runner.os }}-pip-${{ matrix.python-version }}-
40- ${{ runner.os }}-pip-
36+ python-version : ${{ matrix.python-version }}
4137
4238 - name : Install dependencies
43- run : |
44- python -m pip install --upgrade pip
45- pip install -e .[dev]
39+ run : uv sync --all-extras
4640
4741 - name : Lint with Ruff
48- run : ruff check mcp_documents_reader.py tests
42+ run : uv run ruff check mcp_documents_reader.py tests
4943
5044 - name : Check formatting with Ruff
51- run : ruff format --check mcp_documents_reader.py tests
45+ run : uv run ruff format --check mcp_documents_reader.py tests
5246
5347 - name : Type check with Basedpyright
54- run : basedpyright mcp_documents_reader.py
48+ run : uv run basedpyright mcp_documents_reader.py
5549
5650 - name : Run tests with coverage
57- run : pytest --cov-report=xml
51+ run : uv run pytest --cov-report=xml
5852
5953 build :
6054 needs : test
@@ -65,30 +59,19 @@ jobs:
6559 fetch-depth : 0
6660 fetch-tags : true
6761
62+ - name : Install uv
63+ uses : astral-sh/setup-uv@v4
64+
6865 - name : Set up Python
6966 uses : actions/setup-python@v5
7067 with :
7168 python-version : " 3.10"
7269
73- - name : Cache pip dependencies
74- uses : actions/cache@v4
75- with :
76- path : ~/.cache/pip
77- key : ${{ runner.os }}-pip-build-${{ hashFiles('pyproject.toml') }}
78- restore-keys : |
79- ${{ runner.os }}-pip-build-
80- ${{ runner.os }}-pip-
81-
82- - name : Install dependencies
83- run : |
84- python -m pip install --upgrade pip
85- pip install build twine
86-
8770 - name : Build package
88- run : python -m build
71+ run : uv build
8972
9073 - name : Check distribution
91- run : python -m twine check --strict dist/*
74+ run : uv run twine check --strict dist/*
9275
9376 - name : Upload Artifacts
9477 uses : actions/upload-artifact@v4
@@ -136,17 +119,20 @@ jobs:
136119
137120 - name : Update server.json version
138121 run : |
139- VERSION=${{ steps.get_version.outputs.VERSION }}
122+ VERSION=" ${{ steps.get_version.outputs.VERSION }}"
140123 python -c "
141124 import json
125+ import os
142126 with open('server.json', 'r') as f:
143127 data = json.load(f)
144- data['version'] = '$ VERSION'
128+ data['version'] = os.environ.get(' VERSION', '')
145129 for pkg in data.get('packages', []):
146- pkg['version'] = '$ VERSION'
130+ pkg['version'] = os.environ.get(' VERSION', '')
147131 with open('server.json', 'w') as f:
148132 json.dump(data, f, indent=2)
149133 "
134+ env :
135+ VERSION : ${{ steps.get_version.outputs.VERSION }}
150136
151137 - name : Download mcp-publisher
152138 run : |
0 commit comments