Skip to content

Fix the template package and publish to NuGet only - #15

Merged
stphnwlsh merged 2 commits into
mainfrom
fix/template-packaging
Oct 28, 2026
Merged

stphnwlsh merged 2 commits into
mainfrom
fix/template-packaging

Conversation

@stphnwlsh

@stphnwlsh stphnwlsh commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

The NuGet template package was broken. dotnet new install found no template in it because the config folder was named .template_config, every file was flattened into a single folder, and CI packed its own Docker image (image.tar) and coverage report into it, which made it roughly 58 MB.

  • Renamed .template_config to .template.config.
  • template.csproj now packs src, tests, the solution, build files, Dockerfile, docker-compose.yml, icon.png and the dotfiles with their folders intact, and nothing else. The package is now about 130 KB.
  • Renamed the author template parameter to authorName, because dotnet new reserves --author. Usage is now --authorName "Your Name".
  • Renamed the integration test factory to ModelContextProtocolApplication. The old name contained CleanModelContextProtocol, so dotnet new turned it into an invalid class name.
  • New Verify Template step in Build and Test: it fails if the package is over 1 MB, then installs the packed template, creates a solution from it and builds that.
  • Publish no longer pushes to Docker Hub. The image is still built and scanned by Trivy, and the Dockerfile ships with the template.
  • After the NuGet push, Publish creates a GitHub release named after the package version, with the .nupkg attached and notes generated from merged PRs. .github/release.yml puts Dependabot PRs in their own section.

Once this is merged, the DOCKER_LOGIN and DOCKER_TOKEN secrets can be deleted.

Type of change

  • Bug fix
  • New feature
  • Breaking change (the generated solution or template parameters change in a way existing users will notice)
  • Refactoring or clean-up
  • Documentation
  • Build, pipeline or dependency update

Shared layers

  • This only touches the Presentation layer of this template.
  • This touches the Application or Infrastructure layers, tests, pipeline or repository setup, so it needs to be carried across all five templates.

Checklist

  • dotnet build and dotnet test pass locally with no warnings.
  • I added or updated tests, and coverage stays at or above 95%.
  • I updated the README or docs where behaviour changed.
  • I checked the template still installs and creates a working solution (see CONTRIBUTING.md).

Rename .template_config to .template.config, pack src and tests with their
folders intact and only the files a new solution needs, so the CI Docker
image and coverage output no longer end up in the package. Rename the
author symbol to authorName because dotnet new reserves --author. Rename the integration test factory so the generated code compiles.

CI now checks the package size and builds a solution from the packed
template. Publishing stops pushing to Docker Hub and creates a GitHub
release with generated notes for each NuGet version.
@stphnwlsh
stphnwlsh force-pushed the fix/template-packaging branch from daf7471 to de4240a Compare October 28, 2026 14:01
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.72%. Comparing base (b52a67d) to head (e452bf1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #15   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files          42       42           
  Lines         364      364           
  Branches       13       13           
=======================================
  Hits          363      363           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stphnwlsh
stphnwlsh merged commit 1a60256 into main Oct 28, 2026
3 checks passed
@stphnwlsh
stphnwlsh deleted the fix/template-packaging branch October 28, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant