Skip to content

Commit 467b77d

Browse files
committed
release scripts
1 parent a3d2290 commit 467b77d

File tree

5 files changed

+45
-10
lines changed

5 files changed

+45
-10
lines changed

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Install the latest version of uv
13+
uses: astral-sh/setup-uv@v6
14+
- name: Create venv
15+
run: uv venv
16+
- name: Run tests
17+
run: make test
18+
- name: Publish PyPI and npm
19+
run: make publish
20+
env:
21+
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
22+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
23+
- name: Get Version
24+
id: get_version
25+
run: |
26+
version=$(uv run python -c "import mcp_scan; print(mcp_scan.__version__)")
27+
echo "version=$version" >> $GITHUB_OUTPUT
28+
- name: Tag release
29+
run: |
30+
git tag v${{ steps.get_version.outputs.version }}
31+
git push origin v${{ steps.get_version.outputs.version }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ ENV/
4040
src/mcp_scan/todo.md
4141

4242
*.env
43+
npm/package.json

npm/update_package.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

npm/package.json renamed to npm/write_package.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import json
2+
3+
from mcp_scan.version import version_info
4+
5+
package_text = """
16
{
27
"name": "mcp-scan",
38
"version": "0.1.9",
@@ -27,3 +32,9 @@
2732
"README.md"
2833
]
2934
}
35+
"""
36+
37+
package = json.loads(package_text)
38+
package["version"] = version_info
39+
with open("npm/package.json", "w") as f:
40+
json.dump(package, f, indent=2)

src/mcp_scan/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
from .MCPScanner import MCPScanner
2+
from .version import version_info
23

34
__all__ = ["MCPScanner"]
5+
__version__ = version_info

0 commit comments

Comments
 (0)