Skip to content

Commit 9236fea

Browse files
authored
Merge branch 'main' into main
2 parents 34f9215 + 259f11a commit 9236fea

52 files changed

Lines changed: 1635 additions & 815 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Set default behavior to automatically normalize line endings.
2+
* text=auto
3+
4+
*.doc diff=astextplain
5+
*.DOC diff=astextplain
6+
*.docx diff=astextplain
7+
*.DOCX diff=astextplain
8+
*.dot diff=astextplain
9+
*.DOT diff=astextplain
10+
*.pdf diff=astextplain
11+
*.PDF diff=astextplain
12+
*.rtf diff=astextplain
13+
*.RTF diff=astextplain
14+
15+
*.jpg binary
16+
*.png binary
17+
*.gif binary
18+
19+
*.lss text
20+
21+
# Force bash scripts to always use lf line endings so that if a repo is accessed
22+
# in Unix via a file share from Windows, the scripts will work.
23+
*.in text eol=lf
24+
*.sh text eol=lf
25+
26+
# Likewise, force cmd and batch scripts to always use crlf
27+
*.cmd text eol=crlf
28+
*.bat text eol=crlf
29+
30+
*.cs text diff=csharp
31+
*.vb text
32+
*.resx text
33+
*.c text
34+
*.cpp text
35+
*.cxx text
36+
*.h text
37+
*.hxx text
38+
*.py text
39+
*.rb text
40+
*.java text
41+
*.html text
42+
*.htm text
43+
*.css text
44+
*.scss text
45+
*.sass text
46+
*.less text
47+
*.js text
48+
*.lisp text
49+
*.clj text
50+
*.sql text
51+
*.php text
52+
*.lua text
53+
*.m text
54+
*.asm text
55+
*.erl text
56+
*.fs text
57+
*.fsx text
58+
*.hs text
59+
60+
*.csproj text
61+
*.vbproj text
62+
*.fsproj text
63+
*.dbproj text
64+
*.sln text eol=crlf

.github/workflows/ci.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ on:
88

99
jobs:
1010
build:
11-
12-
runs-on: ${{ matrix.os }}
13-
1411
strategy:
1512
matrix:
1613
os: [ubuntu-latest, windows-latest, macos-latest]
1714
configuration: [Debug, Release]
1815
fail-fast: false
1916

20-
steps:
21-
- uses: actions/checkout@v4
17+
runs-on: ${{ matrix.os }}
18+
19+
steps:
20+
- name: Clone the repo
21+
uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
24-
25-
- name: Setup .NET
24+
25+
- name: Set up .NET
2626
uses: actions/setup-dotnet@v4
2727
with:
28-
dotnet-version: |
28+
dotnet-version: |
2929
9.0.x
3030
8.0.x
3131
32-
# Netfx testing on non-Windows requires mono
32+
# NetFX testing on non-Windows requires mono
3333
- name: Setup Mono
3434
if: runner.os == 'Linux'
3535
run: sudo apt-get install -y mono-devel
@@ -38,7 +38,7 @@ jobs:
3838
uses: actions/setup-node@v3
3939
with:
4040
node-version: '20'
41-
41+
4242
- name: Install dependencies for tests
4343
run: npm install @modelcontextprotocol/server-everything
4444

@@ -48,6 +48,9 @@ jobs:
4848
- name: Build
4949
run: dotnet build --configuration ${{ matrix.configuration }}
5050

51+
- name: Pack
52+
run: dotnet pack --configuration ${{ matrix.configuration }}
53+
5154
- name: Test
5255
run: >-
5356
dotnet test
Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
1-
name: Code Coverage
2-
3-
on:
4-
workflow_call:
5-
6-
jobs:
7-
publish-coverage:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: actions/checkout@v4
11-
- name: Setup .NET
12-
uses: actions/setup-dotnet@v4
13-
with:
14-
dotnet-version: |
15-
9.0.x
16-
8.0.x
17-
18-
- name: Download test results
19-
uses: actions/download-artifact@v4
20-
with:
21-
pattern: testresults-*
22-
23-
- name: Combine coverage reports
24-
uses: danielpalme/ReportGenerator-GitHub-Action@5.4.4
25-
with:
26-
reports: "**/*.cobertura.xml"
27-
targetdir: "${{ github.workspace }}/report"
28-
reporttypes: "HtmlSummary;Cobertura;MarkdownSummary;MarkdownSummaryGithub"
29-
verbosity: "Info"
30-
title: "Code Coverage"
31-
tag: "${{ github.run_number }}_${{ github.run_id }}"
32-
customSettings: ""
33-
toolpath: "reportgeneratortool"
34-
35-
- name: Upload combined coverage XML
36-
uses: actions/upload-artifact@v4
37-
with:
38-
name: coverage
39-
path: ${{ github.workspace }}/report
40-
retention-days: 7
41-
42-
- name: Publish code coverage report
43-
uses: irongut/CodeCoverageSummary@v1.3.0
44-
with:
45-
filename: "report/Cobertura.xml"
46-
badge: true
47-
fail_below_min: true
48-
format: markdown
49-
hide_branch_rate: false
50-
hide_complexity: false
51-
indicators: true
52-
output: both
53-
thresholds: "60 80"
54-
55-
- name: Upload combined coverage markdown
56-
uses: actions/upload-artifact@v4
57-
with:
58-
name: coverage-markdown
59-
path: ${{ github.workspace }}/code-coverage-results.md
60-
retention-days: 7
61-
62-
- name: Add Coverage PR Comment
63-
uses: marocchino/sticky-pull-request-comment@v2
64-
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
65-
with:
66-
recreate: true
67-
path: ${{ github.workspace }}/code-coverage-results.md
68-
69-
- name: Coverage on step summary
70-
if: always()
71-
run: cat "${{ github.workspace }}/report/SummaryGithub.md" >> $GITHUB_STEP_SUMMARY
1+
name: Code Coverage
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
publish-coverage:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Setup .NET
12+
uses: actions/setup-dotnet@v4
13+
with:
14+
dotnet-version: |
15+
9.0.x
16+
8.0.x
17+
18+
- name: Download test results
19+
uses: actions/download-artifact@v4
20+
with:
21+
pattern: testresults-*
22+
23+
- name: Combine coverage reports
24+
uses: danielpalme/ReportGenerator-GitHub-Action@5.4.4
25+
with:
26+
reports: "**/*.cobertura.xml"
27+
targetdir: "${{ github.workspace }}/report"
28+
reporttypes: "HtmlSummary;Cobertura;MarkdownSummary;MarkdownSummaryGithub"
29+
verbosity: "Info"
30+
title: "Code Coverage"
31+
tag: "${{ github.run_number }}_${{ github.run_id }}"
32+
customSettings: ""
33+
toolpath: "reportgeneratortool"
34+
35+
- name: Upload combined coverage XML
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: coverage
39+
path: ${{ github.workspace }}/report
40+
retention-days: 7
41+
42+
- name: Publish code coverage report
43+
uses: irongut/CodeCoverageSummary@v1.3.0
44+
with:
45+
filename: "report/Cobertura.xml"
46+
badge: true
47+
fail_below_min: true
48+
format: markdown
49+
hide_branch_rate: false
50+
hide_complexity: false
51+
indicators: true
52+
output: both
53+
thresholds: "60 80"
54+
55+
- name: Upload combined coverage markdown
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: coverage-markdown
59+
path: ${{ github.workspace }}/code-coverage-results.md
60+
retention-days: 7
61+
62+
- name: Add Coverage PR Comment
63+
uses: marocchino/sticky-pull-request-comment@v2
64+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
65+
with:
66+
recreate: true
67+
path: ${{ github.workspace }}/code-coverage-results.md
68+
69+
- name: Coverage on step summary
70+
if: always()
71+
run: cat "${{ github.workspace }}/report/SummaryGithub.md" >> $GITHUB_STEP_SUMMARY

.github/workflows/docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ permissions:
1616
concurrency:
1717
group: "pages"
1818
cancel-in-progress: false
19-
19+
2020
jobs:
2121
publish-docs:
22+
# Only publish from the modelcontextprotocol/csharp-sdk repository
23+
if: ${{ github.repository == 'modelcontextprotocol/csharp-sdk' }}
2224
environment:
2325
name: github-pages
2426
url: ${{ steps.deployment.outputs.page_url }}
@@ -42,4 +44,4 @@ jobs:
4244

4345
- name: Deploy to GitHub Pages
4446
id: deployment
45-
uses: actions/deploy-pages@v4
47+
uses: actions/deploy-pages@v4

.github/workflows/release.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Release Process
2+
3+
The following process is used when publishing new releases to NuGet.org:
4+
5+
1. **Ensure the CI workflow is fully green**
6+
- Some of the integration tests are flaky and require re-running
7+
- Once the state of the branch is known to be good, a release can proceed
8+
- **The release workflow _does not_ run tests**
9+
10+
2. **Create a new Release in GitHub**
11+
- Use the link on the repo home page to [Create a new release](https://github.com/modelcontextprotocol/csharp-sdk/releases/new)
12+
- Click the 'Choose a tag' dropdown button
13+
- Type the name using the `v{major}.{minor}.{patch}-{suffix}` pattern
14+
- Click 'Create new tag: ... on publish'
15+
- Click the 'Target' dropdown button
16+
- Choose the 'Recent Commits' tab
17+
- Select the commit to use for the release, ensuring it's one from above where CI is known to be green
18+
- Click the 'Previous tag' dropdown button
19+
- Choose the previous release to use for generating release notes
20+
- Click the 'Generate release notes button'
21+
- This will add release notes into the Release description
22+
- The generated release notes include what has changed and the list of new contributors
23+
- Verify the Release title
24+
- It will be populated to match the tag name to be created
25+
- This should be retained, using the release title format matching the `v{major}.{minor}.{patch}-{suffix}` format
26+
- Augment the Release description as desired
27+
- This content is presented used on GitHub and is not persisted into any artifacts
28+
- Check the 'Set as a pre-release' button under the release description if appropriate
29+
- Click 'Public release'
30+
31+
3. **Monitor the Release workflow**
32+
- After publishing the release, a workflow will begin for producing the release's build artifacts and publishing the NuGet package to NuGet.org
33+
- If the job fails, troubleshoot and re-run the workflow as needed
34+
- Verify the package version becomes listed on at [https://nuget.org/packages/ModelContextProtocol](https://nuget.org/packages/ModelContextProtocol)
35+
36+
4. **Update the source to increment the version number**
37+
- Immediately after publishing a new release, the [`/src/Directory.Build.Props`](../../src/Directory.Build.props) file needs to be updated to bump the version to the next expected release version

0 commit comments

Comments
 (0)