Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"docfx": {
"version": "2.81.0",
"commands": [
"docfx"
],
"rollForward": false
}
}
}
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: ["**"]
tags-ignore: ["**"]
pull_request:

permissions:
contents: read

jobs:
test:
# windows: unit-тесты ширины глифов XPS берут системный шрифт arial.ttf
runs-on: windows-latest
steps:
- uses: actions/checkout@v5

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build
run: dotnet build PilotMCP.slnx -c Debug --nologo

# Интеграционные тесты (Category=Integration) требуют живой сервер Pilot — в CI только unit-тесты
- name: Unit tests
run: dotnet test PilotMCP.slnx -c Debug --no-build --nologo --filter "Category!=Integration" --logger "trx;LogFileName=unit.trx"

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: "**/TestResults/*.trx"
62 changes: 62 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Docs

on:
push:
branches: [master]
paths:
- 'docs/**'
- 'docfx.json'
- '.config/dotnet-tools.json'
- 'Tools/**'
- 'DocGen/**'
- 'README.md'
- '.github/workflows/docs.yml'
pull_request:
paths:
- 'docs/**'
- 'docfx.json'
- '.config/dotnet-tools.json'
- 'Tools/**'
- 'DocGen/**'
- 'README.md'
- '.github/workflows/docs.yml'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v6
with:
dotnet-version: 8.0.x
# Справочник инструментов docs/tools/ генерируется по коду; падает, если список записи расходится с README
- run: dotnet run --project DocGen
- run: dotnet tool restore
- run: dotnet docfx docfx.json --warningsAsErrors
# manifest.json records the build machine paths and is not part of the site.
- run: rm _site/manifest.json
- uses: actions/upload-pages-artifact@v5
with:
path: _site

deploy:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5
141 changes: 141 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: Release

# Релиз по тегу vX.Y.Z (semver, допускается суффикс -beta.1):
# 1) unit-тесты, сборка zip-архивов win-x64 (PackReleaseArchives в PilotMCP.csproj);
# 2) MCPB-бандл из self-contained сборки (установка в Claude Desktop);
# 3) GitHub Release с архивами и .mcpb;
# 4) публикация метаданных в официальный MCP Registry (OIDC, без секретов).
on:
push:
tags: ["v*"]

permissions:
contents: read

jobs:
build:
runs-on: windows-latest
permissions:
contents: write # создание GitHub Release
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v5

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- uses: actions/setup-node@v5
with:
node-version: "lts/*"

- name: Version from tag
id: ver
run: |
$tag = "${{ github.ref_name }}"
if ($tag -notmatch '^v(\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?)$') { throw "Тег '$tag' должен иметь вид vX.Y.Z" }
$v = $Matches[1]
"version=$v" >> $env:GITHUB_OUTPUT
"prerelease=$([bool]($v -match '-'))".ToLower() >> $env:GITHUB_OUTPUT

- name: Unit tests
run: dotnet test PilotMCP.Tests/PilotMCP.Tests.csproj -c Release --nologo --filter "Category!=Integration"

- name: Build release archives
run: dotnet build PilotMCP.csproj -c Release --nologo -p:Version=${{ steps.ver.outputs.version }}

- name: Build MCPB bundle
id: mcpb
run: |
$v = "${{ steps.ver.outputs.version }}"
$sc = "artifacts/PilotMCP-v$v-win-x64-selfcontained.zip"
if (-not (Test-Path $sc)) { throw "Нет $sc" }

New-Item -ItemType Directory -Force mcpb-build/server | Out-Null
Expand-Archive $sc -DestinationPath mcpb-build/server -Force
$m = Get-Content mcpb/manifest.json -Raw | ConvertFrom-Json
$m.version = $v
$m | ConvertTo-Json -Depth 20 | Set-Content mcpb-build/manifest.json -Encoding utf8NoBOM

npm install -g @anthropic-ai/[email protected]
mcpb validate mcpb-build/manifest.json
if ($LASTEXITCODE -ne 0) { throw "mcpb validate failed" }
$out = "artifacts/PilotMCP-v$v-win-x64.mcpb"
mcpb pack mcpb-build $out
if ($LASTEXITCODE -ne 0) { throw "mcpb pack failed" }

$sha = (Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant()
"sha256=$sha" >> $env:GITHUB_OUTPUT
"file=$out" >> $env:GITHUB_OUTPUT

- name: Prepare server.json for MCP Registry
run: |
$v = "${{ steps.ver.outputs.version }}"
$s = Get-Content server.json -Raw | ConvertFrom-Json
$s.version = $v
$p = $s.packages[0]
$p.version = $v
$p.identifier = "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/PilotMCP-v$v-win-x64.mcpb"
$p.fileSha256 = "${{ steps.mcpb.outputs.sha256 }}"
New-Item -ItemType Directory -Force registry | Out-Null
$s | ConvertTo-Json -Depth 20 | Set-Content registry/server.json -Encoding utf8NoBOM
Get-Content registry/server.json

- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
$v = "${{ steps.ver.outputs.version }}"
$files = @("artifacts/PilotMCP-v$v-win-x64.zip", "artifacts/PilotMCP-v$v-win-x64-selfcontained.zip", "${{ steps.mcpb.outputs.file }}")
$ghArgs = @("release", "create", "${{ github.ref_name }}") + $files + @("--title", "PilotMCP ${{ github.ref_name }}", "--generate-notes")
if ("${{ steps.ver.outputs.prerelease }}" -eq "true") { $ghArgs += "--prerelease" }
gh @ghArgs
if ($LASTEXITCODE -ne 0) { throw "gh release create failed" }

- uses: actions/upload-artifact@v4
with:
name: registry-server-json
path: registry/server.json

publish-registry:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write # OIDC-вход в MCP Registry
contents: read
env:
MCP_PUBLISHER_VERSION: v1.8.9
steps:
- uses: actions/download-artifact@v4
with:
name: registry-server-json

# Шаги ниже — из официальной документации MCP Registry (modelcontextprotocol.io/registry/github-actions)
- name: Install cosign
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2

- name: Download and verify mcp-publisher
run: |
set -euo pipefail
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
arch="$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')"
archive="mcp-publisher_${os}_${arch}.tar.gz"
base_url="https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}"

curl --fail --location --silent --show-error --output "$archive" "$base_url/$archive"
curl --fail --location --silent --show-error --output "$archive.sigstore.json" "$base_url/$archive.sigstore.json"
cosign verify-blob \
--bundle "$archive.sigstore.json" \
--certificate-identity "https://github.com/modelcontextprotocol/registry/.github/workflows/release.yml@refs/tags/${MCP_PUBLISHER_VERSION}" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
"$archive"
tar xzf "$archive" mcp-publisher
rm -f "$archive" "$archive.sigstore.json"

- name: Authenticate to MCP Registry
run: ./mcp-publisher login github-oidc

- name: Publish server to MCP Registry
run: ./mcp-publisher publish
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,8 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd

# Документация (docfx): сайт и сгенерированный справочник инструментов
_site/
docs/tools/
15 changes: 15 additions & 0 deletions DocGen/DocGen.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<!-- Только рефлексия по сборке PilotMCP: сервер MCP не запускается, Pilot не нужен -->
<ProjectReference Include="..\PilotMCP.csproj" />
</ItemGroup>

</Project>
Loading
Loading