mcpcap 0.4.3__tar.gz → 0.4.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcpcap-0.4.5/.github/workflows/release.yml +165 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/PKG-INFO +28 -7
- {mcpcap-0.4.3 → mcpcap-0.4.5}/README.md +1 -1
- {mcpcap-0.4.3 → mcpcap-0.4.5}/pyproject.toml +5 -5
- {mcpcap-0.4.3 → mcpcap-0.4.5}/server.json +2 -2
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap/_version.py +3 -3
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap.egg-info/PKG-INFO +28 -7
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap.egg-info/requires.txt +3 -3
- mcpcap-0.4.3/.github/workflows/release.yml +0 -97
- {mcpcap-0.4.3 → mcpcap-0.4.5}/.github/FUNDING.yml +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/.github/workflows/test.yml +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/.gitignore +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/.readthedocs.yaml +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/LICENSE +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/Makefile +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/source/_static/.gitkeep +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/source/api/cli.rst +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/source/api/core.rst +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/source/api/modules.rst +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/source/conf.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/source/index.rst +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/source/user-guide/analysis-guides.md +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/source/user-guide/installation.md +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/source/user-guide/mcp-integration.md +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/docs/source/user-guide/quickstart.md +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/examples/README.md +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/examples/dhcp.pcap +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/examples/dns.pcap +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/readme-assets/mcpcap-logo.png +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/setup.cfg +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap/__init__.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap/cli.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap/core/__init__.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap/core/config.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap/core/server.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap/modules/__init__.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap/modules/base.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap/modules/dhcp.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap/modules/dns.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap.egg-info/SOURCES.txt +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap.egg-info/dependency_links.txt +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap.egg-info/entry_points.txt +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/src/mcpcap.egg-info/top_level.txt +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/tests/__init__.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/tests/test_cli.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/tests/test_dhcp.py +0 -0
- {mcpcap-0.4.3 → mcpcap-0.4.5}/tests/test_dns.py +0 -0
@@ -0,0 +1,165 @@
|
|
1
|
+
name: Release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- 'v*.*.*' # Triggers on version tags like v1.0.0, v2.1.3, etc.
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
build-and-publish:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
permissions:
|
12
|
+
contents: write # Required for creating releases
|
13
|
+
id-token: write # Required for PyPI trusted publishing
|
14
|
+
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@v4
|
17
|
+
with:
|
18
|
+
# Fetch full history for setuptools-scm to work properly
|
19
|
+
fetch-depth: 0
|
20
|
+
|
21
|
+
- name: Set up Python
|
22
|
+
uses: actions/setup-python@v5
|
23
|
+
with:
|
24
|
+
python-version: "3.11"
|
25
|
+
|
26
|
+
- name: Install build dependencies
|
27
|
+
run: |
|
28
|
+
python -m pip install --upgrade pip
|
29
|
+
pip install build setuptools-scm[toml]
|
30
|
+
|
31
|
+
- name: Verify version matches tag
|
32
|
+
run: |
|
33
|
+
# Extract version from tag (remove 'v' prefix)
|
34
|
+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
35
|
+
# Get version from setuptools-scm
|
36
|
+
DETECTED_VERSION=$(python -c "from setuptools_scm import get_version; print(get_version())")
|
37
|
+
echo "Tag version: $TAG_VERSION"
|
38
|
+
echo "Detected version: $DETECTED_VERSION"
|
39
|
+
# Verify they match
|
40
|
+
if [ "$TAG_VERSION" != "$DETECTED_VERSION" ]; then
|
41
|
+
echo "Version mismatch! Tag: $TAG_VERSION, Detected: $DETECTED_VERSION"
|
42
|
+
exit 1
|
43
|
+
fi
|
44
|
+
|
45
|
+
- name: Build package
|
46
|
+
run: |
|
47
|
+
python -m build
|
48
|
+
|
49
|
+
- name: Verify package contents
|
50
|
+
run: |
|
51
|
+
pip install twine
|
52
|
+
twine check dist/*
|
53
|
+
|
54
|
+
- name: Create GitHub Release
|
55
|
+
run: |
|
56
|
+
# Extract version without 'v' prefix for pip install
|
57
|
+
VERSION=${GITHUB_REF_NAME#v}
|
58
|
+
|
59
|
+
# Get previous tag for release notes generation
|
60
|
+
PREV_TAG=$(git tag --sort=-version:refname | grep -v "$GITHUB_REF_NAME" | head -1)
|
61
|
+
|
62
|
+
# Create release with auto-generated notes
|
63
|
+
if [ -n "$PREV_TAG" ]; then
|
64
|
+
gh release create $GITHUB_REF_NAME \
|
65
|
+
--title "Release $GITHUB_REF_NAME" \
|
66
|
+
--generate-notes \
|
67
|
+
--notes-start-tag "$PREV_TAG"
|
68
|
+
else
|
69
|
+
# First release, no previous tag
|
70
|
+
gh release create $GITHUB_REF_NAME \
|
71
|
+
--title "Release $GITHUB_REF_NAME" \
|
72
|
+
--generate-notes
|
73
|
+
fi
|
74
|
+
|
75
|
+
# Add installation instructions to the beginning
|
76
|
+
gh release edit $GITHUB_REF_NAME \
|
77
|
+
--notes "$(echo "## Installation
|
78
|
+
\`\`\`bash
|
79
|
+
pip install mcpcap==$VERSION
|
80
|
+
\`\`\`
|
81
|
+
|
82
|
+
$(gh release view $GITHUB_REF_NAME --json body -q .body)")"
|
83
|
+
env:
|
84
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
85
|
+
|
86
|
+
- name: Publish to PyPI
|
87
|
+
id: pypi_publish
|
88
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
89
|
+
# Uses PyPI's trusted publisher (OIDC). Configure project on PyPI first.
|
90
|
+
|
91
|
+
# -------- MCP Registry: best practice - align server.json version ----------
|
92
|
+
- name: Update server.json version to tag
|
93
|
+
if: steps.pypi_publish.outcome == 'success'
|
94
|
+
run: |
|
95
|
+
sudo apt-get update && sudo apt-get install -y jq
|
96
|
+
VERSION=${GITHUB_REF#refs/tags/v}
|
97
|
+
if [ -f server.json ]; then
|
98
|
+
echo "Setting server.json version to ${VERSION}"
|
99
|
+
jq --arg version "$VERSION" '.version = $version' server.json > server.json.tmp
|
100
|
+
mv server.json.tmp server.json
|
101
|
+
else
|
102
|
+
echo "server.json not found at repo root; skipping version update"
|
103
|
+
fi
|
104
|
+
|
105
|
+
# -------- MCP Registry: install publisher (build from source) --------------
|
106
|
+
- name: Set up Go (for building mcp-publisher)
|
107
|
+
if: steps.pypi_publish.outcome == 'success'
|
108
|
+
uses: actions/setup-go@v5
|
109
|
+
with:
|
110
|
+
go-version: '1.22.x'
|
111
|
+
|
112
|
+
- name: Install MCP Publisher
|
113
|
+
if: steps.pypi_publish.outcome == 'success'
|
114
|
+
run: |
|
115
|
+
git clone https://github.com/modelcontextprotocol/registry publisher-repo
|
116
|
+
cd publisher-repo
|
117
|
+
make publisher
|
118
|
+
cp cmd/publisher/bin/mcp-publisher ../mcp-publisher
|
119
|
+
cd ..
|
120
|
+
chmod +x mcp-publisher
|
121
|
+
./mcp-publisher --version || true
|
122
|
+
|
123
|
+
# -------- MCP Registry: login with DNS (mcpcap.ai) ------------------------
|
124
|
+
- name: Write DNS auth private key
|
125
|
+
if: steps.pypi_publish.outcome == 'success'
|
126
|
+
run: |
|
127
|
+
umask 177
|
128
|
+
cat > key.pem << 'EOF'
|
129
|
+
${{ secrets.MCP_PRIVATE_KEY }}
|
130
|
+
EOF
|
131
|
+
# Verify file permissions (should be 600)
|
132
|
+
ls -l key.pem
|
133
|
+
|
134
|
+
- name: Login to MCP Registry (DNS)
|
135
|
+
if: steps.pypi_publish.outcome == 'success'
|
136
|
+
run: ./mcp-publisher login dns --domain mcpcap.ai --private-key-file key.pem
|
137
|
+
|
138
|
+
- name: Cleanup DNS auth key
|
139
|
+
if: steps.pypi_publish.outcome == 'success'
|
140
|
+
run: |
|
141
|
+
shred -u key.pem || rm -f key.pem
|
142
|
+
|
143
|
+
# -------- (Optional) Validate server.json before publishing ----------------
|
144
|
+
- name: Validate server.json (optional)
|
145
|
+
if: steps.pypi_publish.outcome == 'success'
|
146
|
+
run: |
|
147
|
+
if [ -f server.json ]; then
|
148
|
+
curl -s https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json | jq . > schema.json
|
149
|
+
npm i -g ajv-cli >/dev/null 2>&1 || true
|
150
|
+
ajv validate -s schema.json -d server.json || (echo "server.json failed schema validation"; exit 1)
|
151
|
+
else
|
152
|
+
echo "server.json not found; skipping validation"
|
153
|
+
fi
|
154
|
+
|
155
|
+
# -------- MCP Registry: publish -------------------------------------------
|
156
|
+
- name: Publish to MCP Registry
|
157
|
+
if: steps.pypi_publish.outcome == 'success'
|
158
|
+
run: ./mcp-publisher publish
|
159
|
+
|
160
|
+
- name: Upload build artifacts
|
161
|
+
uses: actions/upload-artifact@v4
|
162
|
+
with:
|
163
|
+
name: dist-files
|
164
|
+
path: dist/
|
165
|
+
retention-days: 30
|
@@ -1,10 +1,31 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcpcap
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.5
|
4
4
|
Summary: A modular Python MCP Server for analyzing PCAP files
|
5
5
|
Author: mcpcap contributors
|
6
|
-
License: MIT
|
7
|
-
|
6
|
+
License: MIT License
|
7
|
+
|
8
|
+
Copyright (c) 2025 danohn
|
9
|
+
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
12
|
+
in the Software without restriction, including without limitation the rights
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
15
|
+
furnished to do so, subject to the following conditions:
|
16
|
+
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
18
|
+
copies or substantial portions of the Software.
|
19
|
+
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
26
|
+
SOFTWARE.
|
27
|
+
|
28
|
+
Project-URL: Homepage, https://mcpcap.ai
|
8
29
|
Project-URL: Repository, https://github.com/mcpcap/mcpcap
|
9
30
|
Project-URL: Issues, https://github.com/mcpcap/mcpcap/issues
|
10
31
|
Keywords: pcap,network,analysis,mcp,dns
|
@@ -21,9 +42,9 @@ Classifier: Topic :: Security
|
|
21
42
|
Requires-Python: >=3.10
|
22
43
|
Description-Content-Type: text/markdown
|
23
44
|
License-File: LICENSE
|
24
|
-
Requires-Dist: fastmcp
|
25
|
-
Requires-Dist: scapy
|
26
|
-
Requires-Dist: requests
|
45
|
+
Requires-Dist: fastmcp~=2.12.2
|
46
|
+
Requires-Dist: scapy~=2.6.1
|
47
|
+
Requires-Dist: requests~=2.32.5
|
27
48
|
Provides-Extra: test
|
28
49
|
Requires-Dist: pytest; extra == "test"
|
29
50
|
Requires-Dist: pytest-cov; extra == "test"
|
@@ -44,7 +65,7 @@ Dynamic: license-file
|
|
44
65
|
|
45
66
|
# mcpcap
|
46
67
|
|
47
|
-
|
68
|
+
<!-- mcp-name: ai.mcpcap/mcpcap -->
|
48
69
|
|
49
70
|

|
50
71
|
|
@@ -7,7 +7,7 @@ name = "mcpcap"
|
|
7
7
|
dynamic = ["version"]
|
8
8
|
description = "A modular Python MCP Server for analyzing PCAP files"
|
9
9
|
readme = "README.md"
|
10
|
-
license = {
|
10
|
+
license = {file = "LICENSE"}
|
11
11
|
requires-python = ">=3.10"
|
12
12
|
authors = [
|
13
13
|
{name = "mcpcap contributors"}
|
@@ -26,9 +26,9 @@ classifiers = [
|
|
26
26
|
"Topic :: Security",
|
27
27
|
]
|
28
28
|
dependencies = [
|
29
|
-
"fastmcp",
|
30
|
-
"scapy",
|
31
|
-
"requests",
|
29
|
+
"fastmcp~=2.12.2", # >=2.12.2,<2.13
|
30
|
+
"scapy~=2.6.1", # >=2.6.1,<2.7
|
31
|
+
"requests~=2.32.5", # >=2.32.5,<2.33
|
32
32
|
]
|
33
33
|
|
34
34
|
[project.optional-dependencies]
|
@@ -53,7 +53,7 @@ docs = [
|
|
53
53
|
]
|
54
54
|
|
55
55
|
[project.urls]
|
56
|
-
Homepage = "https://
|
56
|
+
Homepage = "https://mcpcap.ai"
|
57
57
|
Repository = "https://github.com/mcpcap/mcpcap"
|
58
58
|
Issues = "https://github.com/mcpcap/mcpcap/issues"
|
59
59
|
|
@@ -7,13 +7,13 @@
|
|
7
7
|
"url": "https://github.com/mcpcap/mcpcap",
|
8
8
|
"source": "github"
|
9
9
|
},
|
10
|
-
"version": "0.4.
|
10
|
+
"version": "0.4.4",
|
11
11
|
"packages": [
|
12
12
|
{
|
13
13
|
"registry_type": "pypi",
|
14
14
|
"registry_base_url": "https://pypi.org",
|
15
15
|
"identifier": "mcpcap",
|
16
|
-
"version": "0.4.
|
16
|
+
"version": "0.4.4",
|
17
17
|
"transport": {
|
18
18
|
"type": "stdio"
|
19
19
|
}
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
28
28
|
commit_id: COMMIT_ID
|
29
29
|
__commit_id__: COMMIT_ID
|
30
30
|
|
31
|
-
__version__ = version = '0.4.
|
32
|
-
__version_tuple__ = version_tuple = (0, 4,
|
31
|
+
__version__ = version = '0.4.5'
|
32
|
+
__version_tuple__ = version_tuple = (0, 4, 5)
|
33
33
|
|
34
|
-
__commit_id__ = commit_id = '
|
34
|
+
__commit_id__ = commit_id = 'g238af620f'
|
@@ -1,10 +1,31 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcpcap
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.5
|
4
4
|
Summary: A modular Python MCP Server for analyzing PCAP files
|
5
5
|
Author: mcpcap contributors
|
6
|
-
License: MIT
|
7
|
-
|
6
|
+
License: MIT License
|
7
|
+
|
8
|
+
Copyright (c) 2025 danohn
|
9
|
+
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
12
|
+
in the Software without restriction, including without limitation the rights
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
15
|
+
furnished to do so, subject to the following conditions:
|
16
|
+
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
18
|
+
copies or substantial portions of the Software.
|
19
|
+
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
26
|
+
SOFTWARE.
|
27
|
+
|
28
|
+
Project-URL: Homepage, https://mcpcap.ai
|
8
29
|
Project-URL: Repository, https://github.com/mcpcap/mcpcap
|
9
30
|
Project-URL: Issues, https://github.com/mcpcap/mcpcap/issues
|
10
31
|
Keywords: pcap,network,analysis,mcp,dns
|
@@ -21,9 +42,9 @@ Classifier: Topic :: Security
|
|
21
42
|
Requires-Python: >=3.10
|
22
43
|
Description-Content-Type: text/markdown
|
23
44
|
License-File: LICENSE
|
24
|
-
Requires-Dist: fastmcp
|
25
|
-
Requires-Dist: scapy
|
26
|
-
Requires-Dist: requests
|
45
|
+
Requires-Dist: fastmcp~=2.12.2
|
46
|
+
Requires-Dist: scapy~=2.6.1
|
47
|
+
Requires-Dist: requests~=2.32.5
|
27
48
|
Provides-Extra: test
|
28
49
|
Requires-Dist: pytest; extra == "test"
|
29
50
|
Requires-Dist: pytest-cov; extra == "test"
|
@@ -44,7 +65,7 @@ Dynamic: license-file
|
|
44
65
|
|
45
66
|
# mcpcap
|
46
67
|
|
47
|
-
|
68
|
+
<!-- mcp-name: ai.mcpcap/mcpcap -->
|
48
69
|
|
49
70
|

|
50
71
|
|
@@ -1,97 +0,0 @@
|
|
1
|
-
name: Release
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags:
|
6
|
-
- 'v*.*.*' # Triggers on version tags like v1.0.0, v2.1.3, etc.
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
build-and-publish:
|
10
|
-
runs-on: ubuntu-latest
|
11
|
-
permissions:
|
12
|
-
contents: write # Required for creating releases
|
13
|
-
id-token: write # Required for PyPI trusted publishing
|
14
|
-
|
15
|
-
steps:
|
16
|
-
- uses: actions/checkout@v4
|
17
|
-
with:
|
18
|
-
# Fetch full history for setuptools-scm to work properly
|
19
|
-
fetch-depth: 0
|
20
|
-
|
21
|
-
- name: Set up Python
|
22
|
-
uses: actions/setup-python@v5
|
23
|
-
with:
|
24
|
-
python-version: "3.11"
|
25
|
-
|
26
|
-
- name: Install build dependencies
|
27
|
-
run: |
|
28
|
-
python -m pip install --upgrade pip
|
29
|
-
pip install build setuptools-scm[toml]
|
30
|
-
|
31
|
-
- name: Verify version matches tag
|
32
|
-
run: |
|
33
|
-
# Extract version from tag (remove 'v' prefix)
|
34
|
-
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
35
|
-
# Get version from setuptools-scm
|
36
|
-
DETECTED_VERSION=$(python -c "from setuptools_scm import get_version; print(get_version())")
|
37
|
-
echo "Tag version: $TAG_VERSION"
|
38
|
-
echo "Detected version: $DETECTED_VERSION"
|
39
|
-
# Verify they match
|
40
|
-
if [ "$TAG_VERSION" != "$DETECTED_VERSION" ]; then
|
41
|
-
echo "Version mismatch! Tag: $TAG_VERSION, Detected: $DETECTED_VERSION"
|
42
|
-
exit 1
|
43
|
-
fi
|
44
|
-
|
45
|
-
- name: Build package
|
46
|
-
run: |
|
47
|
-
python -m build
|
48
|
-
|
49
|
-
- name: Verify package contents
|
50
|
-
run: |
|
51
|
-
pip install twine
|
52
|
-
twine check dist/*
|
53
|
-
|
54
|
-
- name: Create GitHub Release
|
55
|
-
run: |
|
56
|
-
# Extract version without 'v' prefix for pip install
|
57
|
-
VERSION=${GITHUB_REF_NAME#v}
|
58
|
-
|
59
|
-
# Get previous tag for release notes generation
|
60
|
-
PREV_TAG=$(git tag --sort=-version:refname | grep -v "$GITHUB_REF_NAME" | head -1)
|
61
|
-
|
62
|
-
# Create release with auto-generated notes
|
63
|
-
if [ -n "$PREV_TAG" ]; then
|
64
|
-
gh release create $GITHUB_REF_NAME \
|
65
|
-
--title "Release $GITHUB_REF_NAME" \
|
66
|
-
--generate-notes \
|
67
|
-
--notes-start-tag "$PREV_TAG"
|
68
|
-
else
|
69
|
-
# First release, no previous tag
|
70
|
-
gh release create $GITHUB_REF_NAME \
|
71
|
-
--title "Release $GITHUB_REF_NAME" \
|
72
|
-
--generate-notes
|
73
|
-
fi
|
74
|
-
|
75
|
-
# Add installation instructions to the beginning
|
76
|
-
gh release edit $GITHUB_REF_NAME \
|
77
|
-
--notes "$(echo "## Installation
|
78
|
-
\`\`\`bash
|
79
|
-
pip install mcpcap==$VERSION
|
80
|
-
\`\`\`
|
81
|
-
|
82
|
-
$(gh release view $GITHUB_REF_NAME --json body -q .body)")"
|
83
|
-
env:
|
84
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
85
|
-
|
86
|
-
- name: Publish to PyPI
|
87
|
-
uses: pypa/gh-action-pypi-publish@release/v1
|
88
|
-
# Note: This uses PyPI's trusted publisher feature
|
89
|
-
# You'll need to configure this in your PyPI project settings
|
90
|
-
# Alternative: use password-based auth with secrets.PYPI_API_TOKEN
|
91
|
-
|
92
|
-
- name: Upload build artifacts
|
93
|
-
uses: actions/upload-artifact@v4
|
94
|
-
with:
|
95
|
-
name: dist-files
|
96
|
-
path: dist/
|
97
|
-
retention-days: 30
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|