Skip to content

fix: pack the dotnet new template so a tagged release publishes something - #4

Merged
davidnmbond merged 1 commit into
mainfrom
fix/template-package
Oct 5, 2026
Merged

davidnmbond merged 1 commit into
mainfrom
fix/template-package

Conversation

@davidnmbond

Copy link
Copy Markdown
Contributor

Problem

Meraki.Cli is a dotnet new template package, but CI never produced a package. dotnet pack ran over a solution whose only project is a non-packable Worker SDK app, and Meraki.Cli.nuspec listed no files, so no .nupkg was created. On a release tag the publish job would have had nothing to push.

Changes

  • package/Meraki.Cli.Template.csproj (PackageType=Template) packs content/ and carries the metadata from the old nuspec. It lives in a subfolder because a project next to the .slnx makes a bare dotnet restore fail with "more than one project or solution file". The standard CI pack step now works unchanged and produces exactly one package.
  • Deleted Meraki.Cli.nuspec: superseded, and it hardcoded version 10.0.0.
  • version.json 1.0 -> 10.0: nuget.org already has Meraki.Cli up to 7.0.8 (the nuspec's 10.0.0 was never published). At 1.0.x, new releases would be lower than the existing latest and never picked up by dotnet new install Meraki.Cli. Release-affecting: please confirm 10.0 is the version line you want.
  • Ships Directory.Packages.props with the template: content/Meraki.Cli.csproj has no package versions of its own (central package management), so a generated project could not restore outside this repository.
  • Leaves content.sln out of the package: next to the generated .csproj it made a bare dotnet build fail with MSB1011.

Verification

  • From the repo root: dotnet restore, dotnet build -c Release (0 warnings, 0 errors) and dotnet pack -c Release --no-build produce exactly one package.
  • Installed that package into an isolated template hive (--debug:custom-hive, so nothing touched the machine's template cache), ran dotnet new meraki -n Demo.App --apiKey=abc, confirmed the key was substituted, and dotnet build of the generated project: 0 warnings, 0 errors.
  • Not exercised: the tag-triggered publish job itself (needs a real tag and the NuGet login).

🤖 Generated with Claude Code

…hing

CI ran `dotnet pack` over a solution whose only project is a non-packable Worker SDK
app, and Meraki.Cli.nuspec listed no files, so no .nupkg was produced and a release tag
would have had nothing to push.

- add package/Meraki.Cli.Template.csproj (PackageType=Template) that packs content/ and
  carries the old nuspec metadata; it sits in a subfolder because a project next to the
  .slnx makes a bare `dotnet restore` ambiguous. The standard CI pack step now works unchanged.
- delete the superseded Meraki.Cli.nuspec (it also hardcoded version 10.0.0)
- version.json 1.0 -> 10.0: nuget.org already has up to 7.0.8, so 1.0.x would never be
  picked up as the latest
- ship Directory.Packages.props with the template: the content csproj has no package
  versions of its own, so a generated project could not restore
- leave content.sln out of the package: next to the generated .csproj it made a bare
  `dotnet build` fail with MSB1011

Verified: restore/build/pack from the root gives one package; installing it into an isolated
template hive, generating a project with --apiKey and building it gives 0 warnings, 0 errors.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@davidnmbond
davidnmbond merged commit e8a7fc4 into main Oct 5, 2026
5 checks passed
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