Skip to content

Conversation

@jeffhandley
Copy link
Collaborator

@jeffhandley jeffhandley commented Mar 27, 2025

Summary of Changes

  • Refactored Directory Build Properties: Updated Directory.Build.props and src/Directory.Build.props to include new properties for artifact directories, versioning, and authorship. This results in all build output going into the top-level artifacts folder and NuGet packages produced from the /src/ folder having the desired metadata.
  • Updated Release Workflow: Updated .github/workflows/release.yml to handle the publishing of NuGet packages, including daily and manual runs, as well as official releases. This workflow replaces the previous release workflow. The release workflow performs a build on all configs for validation, but it does not run tests. We need to make sure CI is green before minting a release.
  • Conditional Publishing in Docs Workflow: Updated the publish-docs job in .github/workflows/docs.yml to only publish from the modelcontextprotocol/csharp-sdk repository.
  • De-duplicated the README: The repo README is reused into the NuGet package without its content being duplicated in the tree.

Daily and Manual Runs

  • Triggered automatically at 07:00 UTC daily
  • Triggered manually using GitHub Actions workflow_dispatch event
  • Version prefix applied from /src/Directory.Build.props
  • Version suffix set to ci.{github.run_number}
  • Manual runs allow the version suffix to be overridden with input
  • Package published to GitHub package registry

Official Releases

  • Triggered after a GitHub Release is created
  • Version prefix applied from /src/Directory.Build.props
  • Version suffix applied from /src/Directory.Build.props
  • Package published to GitHub package registry
  • Package published to NuGet.org
  • Version prefix and/or suffix should be updated after each release

@jeffhandley jeffhandley added the area-infrastructure Related to repo infrastructure label Mar 27, 2025
@jeffhandley jeffhandley self-assigned this Mar 27, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR configures package publishing for daily, manual, and release builds by refactoring build properties and updating GitHub Actions workflows.

  • Updated release workflow to trigger on a schedule, manual events, and GitHub releases while leveraging the ci.yml workflow
  • Adjusted docs workflow to conditionally publish only for the specified repository
  • Enabled workflow_call in the ci.yml workflow to support invocation from other workflows

Reviewed Changes

Copilot reviewed 4 out of 8 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/release.yml Modified to include new triggers, dynamic version suffix handling, and updated job naming
.github/workflows/docs.yml Added conditional publishing logic based on the repository name
.github/workflows/ci.yml Enabled workflow_call to allow external invocation of the CI workflow
Files not reviewed (4)
  • Directory.Build.props: Language not supported
  • src/Directory.Build.props: Language not supported
  • src/ModelContextProtocol/ModelContextProtocol.csproj: Language not supported
  • tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj: Language not supported
Comments suppressed due to low confidence (1)

.github/workflows/release.yml:38

  • Ensure that the 'format' function used in the expression is supported in GitHub Actions. If not, consider an alternative approach for string formatting.
version_suffix_args: ${{ github.event_name != 'release' && format('--version-suffix "ci.{0}"', github.run_number) || '' }}

@jeffhandley jeffhandley requested a review from Copilot March 27, 2025 06:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR sets up package publishing for daily, manual, and release builds by updating GitHub Actions workflows.

  • Updated the release workflow to include scheduled daily triggers, manual runs, and conditional NuGet publishing based on the repository.
  • Added a conditional check to the docs workflow to publish documentation only from the specified repository.
  • Modified the CI workflow to support workflow calls for better reusability.

Reviewed Changes

Copilot reviewed 4 out of 8 changed files in this pull request and generated no comments.

File Description
.github/workflows/release.yml Refined triggers and added conditional environment logic for version suffixing and publishing steps.
.github/workflows/docs.yml Added a condition to ensure docs are published only from the modelcontextprotocol/csharp-sdk repo.
.github/workflows/ci.yml Introduced workflow_call trigger for potential CI reusability.
Files not reviewed (4)
  • Directory.Build.props: Language not supported
  • src/Directory.Build.props: Language not supported
  • src/ModelContextProtocol/ModelContextProtocol.csproj: Language not supported
  • tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj: Language not supported
Comments suppressed due to low confidence (2)

.github/workflows/release.yml:38

  • [nitpick] Consider refactoring or simplifying the conditional expression for 'version_suffix_args' to improve readability and maintainability.
version_suffix_args: ${{ github.event_name != 'release' && format('--version-suffix "ci.{0}"', github.run_number) || '' }}

.github/workflows/release.yml:30

  • [nitpick] The job name 'run-ci' could be more descriptive. Consider renaming it (for example, to 'ci-build') to clearly indicate its purpose.
run-ci:

@jeffhandley jeffhandley merged commit 259f11a into modelcontextprotocol:main Mar 27, 2025
8 checks passed
@jeffhandley jeffhandley deleted the jeffhandley/ci-build-packaging branch March 28, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Related to repo infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants