Skip to content

Commit d32a716

Browse files
Package MCP server as NuGet tool and add publish workflows
- Configure Testimize.MCP.Server.csproj as a .NET global tool (testimize-mcp command) with full package metadata - Add publish-mcp-nuget.yml workflow to publish the MCP server on mcp-v*.*.* tags, releases, or manual dispatch - Rework publish-nuget.yml to match: tag/release/dispatch triggers, version resolution, --skip-duplicate, and artifact upload - Add docs/PROJECT_KNOWLEDGE.md with shareable guidance for consuming Testimize and the MCP server from other projects Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d0cc983 commit d32a716

File tree

4 files changed

+362
-6
lines changed

4 files changed

+362
-6
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: 📦 Publish MCP Server NuGet Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'mcp-v*.*.*' # Triggers on MCP version tags like mcp-v1.0.0
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'Override package version (optional, e.g. 1.0.1)'
13+
required: false
14+
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
jobs:
20+
publish:
21+
name: Publish Testimize.MCP.Server to NuGet.org
22+
runs-on: ubuntu-latest
23+
environment: production
24+
25+
steps:
26+
- name: Checkout Code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup .NET
30+
uses: actions/setup-dotnet@v4
31+
with:
32+
dotnet-version: '8.x'
33+
34+
- name: Resolve Package Version
35+
id: version
36+
shell: bash
37+
run: |
38+
if [ -n "${{ github.event.inputs.version }}" ]; then
39+
echo "value=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
40+
elif [[ "${GITHUB_REF}" == refs/tags/mcp-v* ]]; then
41+
echo "value=${GITHUB_REF#refs/tags/mcp-v}" >> "$GITHUB_OUTPUT"
42+
elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
43+
echo "value=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
44+
else
45+
echo "value=" >> "$GITHUB_OUTPUT"
46+
fi
47+
48+
- name: Restore Dependencies
49+
run: dotnet restore ./Testimize.MCP.Server/Testimize.MCP.Server.csproj
50+
51+
- name: Build Project
52+
run: dotnet build ./Testimize.MCP.Server/Testimize.MCP.Server.csproj --configuration Release --no-restore
53+
54+
- name: Pack NuGet Package
55+
run: |
56+
if [ -n "${{ steps.version.outputs.value }}" ]; then
57+
dotnet pack ./Testimize.MCP.Server/Testimize.MCP.Server.csproj \
58+
--configuration Release --no-build \
59+
-p:Version=${{ steps.version.outputs.value }} \
60+
--output ./nupkg
61+
else
62+
dotnet pack ./Testimize.MCP.Server/Testimize.MCP.Server.csproj \
63+
--configuration Release --no-build \
64+
--output ./nupkg
65+
fi
66+
67+
- name: Push to NuGet.org
68+
run: |
69+
dotnet nuget push ./nupkg/Testimize.MCP.Server.*.nupkg \
70+
--api-key ${{ secrets.NUGETKEY }} \
71+
--source https://api.nuget.org/v3/index.json \
72+
--skip-duplicate
73+
74+
- name: Upload Package Artifact
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: testimize-mcp-nupkg
78+
path: ./nupkg/*.nupkg
Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
name: 📦 Publish NuGet Package
1+
name: 📦 Publish Testimize NuGet Package
22

33
on:
44
push:
55
tags:
6-
- 'v*.*.*' # Triggers on version tags like v1.1.6
6+
- 'v*.*.*' # Triggers on core version tags like v1.1.8
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'Override package version (optional, e.g. 1.1.9)'
13+
required: false
714

815
permissions:
916
contents: read
1017
packages: write
1118

1219
jobs:
1320
publish:
14-
name: Publish to NuGet.org
21+
name: Publish Testimize to NuGet.org
1522
runs-on: ubuntu-latest
1623
environment: production
1724

@@ -24,14 +31,46 @@ jobs:
2431
with:
2532
dotnet-version: '8.x'
2633

34+
- name: Resolve Package Version
35+
id: version
36+
shell: bash
37+
run: |
38+
if [ -n "${{ github.event.inputs.version }}" ]; then
39+
echo "value=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
40+
elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
41+
echo "value=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
42+
else
43+
echo "value=" >> "$GITHUB_OUTPUT"
44+
fi
45+
2746
- name: Restore Dependencies
2847
run: dotnet restore ./Testimize/Testimize.csproj
2948

3049
- name: Build Project
3150
run: dotnet build ./Testimize/Testimize.csproj --configuration Release --no-restore
3251

3352
- name: Pack NuGet Package
34-
run: dotnet pack ./Testimize/Testimize.csproj --configuration Release --no-build --output ./nupkg
53+
run: |
54+
if [ -n "${{ steps.version.outputs.value }}" ]; then
55+
dotnet pack ./Testimize/Testimize.csproj \
56+
--configuration Release --no-build \
57+
-p:Version=${{ steps.version.outputs.value }} \
58+
--output ./nupkg
59+
else
60+
dotnet pack ./Testimize/Testimize.csproj \
61+
--configuration Release --no-build \
62+
--output ./nupkg
63+
fi
3564
3665
- name: Push to NuGet.org
37-
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGETKEY }} --source https://api.nuget.org/v3/index.json
66+
run: |
67+
dotnet nuget push ./nupkg/Testimize.*.nupkg \
68+
--api-key ${{ secrets.NUGETKEY }} \
69+
--source https://api.nuget.org/v3/index.json \
70+
--skip-duplicate
71+
72+
- name: Upload Package Artifact
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: testimize-nupkg
76+
path: ./nupkg/*.nupkg

Testimize.MCP.Server/Testimize.MCP.Server.csproj

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,39 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
9-
<NoWarn>$(NoWarn);1591</NoWarn>
9+
<NoWarn>$(NoWarn);1591;NU5100;NU5128</NoWarn>
1010
</PropertyGroup>
1111

12+
<!-- NuGet / .NET global tool packaging -->
13+
<PropertyGroup>
14+
<IsPackable>true</IsPackable>
15+
<PackAsTool>true</PackAsTool>
16+
<ToolCommandName>testimize-mcp</ToolCommandName>
17+
<PackageId>Testimize.MCP.Server</PackageId>
18+
<Version>1.0.0</Version>
19+
<AssemblyVersion>1.0.0.0</AssemblyVersion>
20+
<FileVersion>1.0.0.0</FileVersion>
21+
<Authors>Anton Angelov</Authors>
22+
<Company>Automate The Planet Ltd.</Company>
23+
<Product>Testimize MCP Server</Product>
24+
<Copyright>Copyright © Automate The Planet Ltd. 2025</Copyright>
25+
<Description>Model Context Protocol (MCP) server exposing Testimize test-data generation to AI assistants (Claude Code, GitHub Copilot, Cursor). Also runs as a standalone REST API. Install as a .NET global tool: `dotnet tool install --global Testimize.MCP.Server`.</Description>
26+
<PackageTags>testimize;mcp;model-context-protocol;ai;copilot;claude;test-data;dotnet-tool</PackageTags>
27+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
28+
<PackageReadmeFile>README.md</PackageReadmeFile>
29+
<PackageIcon>testimize_nuget_icon.png</PackageIcon>
30+
<PackageProjectUrl>https://github.com/AutomateThePlanet/Testimize</PackageProjectUrl>
31+
<RepositoryUrl>https://github.com/AutomateThePlanet/Testimize</RepositoryUrl>
32+
<RepositoryType>git</RepositoryType>
33+
<PackageReleaseNotes>Initial release of the Testimize MCP Server as a .NET global tool.</PackageReleaseNotes>
34+
</PropertyGroup>
35+
36+
<ItemGroup>
37+
<None Include="..\LICENSE" Pack="true" PackagePath="" />
38+
<None Include="README.md" Pack="true" PackagePath="" />
39+
<None Include="..\testimize_nuget_icon.png" Pack="true" PackagePath="" />
40+
</ItemGroup>
41+
1242
<ItemGroup>
1343
<Content Remove="testimizeSettings.json" />
1444
</ItemGroup>

0 commit comments

Comments
 (0)