Refresh .NET versions
Move every resource to the latest released (GA) versions of .NET, C#, and F#, and every package pin in templates/Directory.Packages.props and every action pin in an opinions/ code block to its latest stable version.
Trigger
The .github/workflows/dotnet-release-watch.yml workflow checks the official releases index daily. When the GA state changes, it opens a trigger pull request labelled dotnet-release on the branch automation/dotnet-release-watch.
- The trigger pull request only updates the snapshot in
.github/state/dotnet-releases.json. It's the cue to run this skill. - Never commit to
automation/dotnet-release-watch. Untilmainhas the new snapshot, each run of the workflow rebuilds that branch frommainand force-pushes it, so a commit there is lost. - The skill works on its own branch, which step 3 starts, and copies the snapshot there. The refresh pull request then merges the snapshot and the update together, and step 8 closes the trigger pull request.
- You can also run the skill by itself. The snapshot answers "Which GA versions does this repository know about?" offline.
Orchestration
As agents/orchestration.md describes, delegate the web lookups to worker agents: the version checks in step 1, the nuget.org lookups in step 4b, the action release lookups in step 4c, and the "What's new" reading in step 5. Only the editor decides what changes, and edits opinions/ and templates/.
Steps
- Find the latest released versions.
- .NET: https://dotnet.microsoft.com/download/dotnet and the release announcement on the .NET Blog.
- C#: https://learn.microsoft.com/dotnet/csharp/whats-new/.
- F#: https://learn.microsoft.com/dotnet/fsharp/whats-new/.
- Use GA releases only. A preview or release candidate can appear in a "Coming next" note, never as the target.
- Compare with the current targets: the
targets:metadata inopinions/, the version pins intemplates/, and the rootglobal.json. The template pins are theglobal.jsonSDK version,<TargetFramework>in project files, and<LangVersion>if it's pinned.- If everything matches, the framework part has nothing to do. Say so, and still run steps 4b and 4c, because package and action pins drift on their own schedule. Check step 4a for a band the repository now needs.
- Report "up to date" and stop only when those checks find nothing too.
- If you stop here while a trigger pull request is open, check that its snapshot names the release step 1 found, and say that it can merge as it is. It holds only the snapshot, and nothing else lands it on
main. If the snapshot names a newer release, run steps 1 and 2 again for that release.
- Start a worktree from
mainon the branchrefresh/dotnet-<version>, following the rules in agents/worktrees.md.- To find an open trigger pull request, run
gh pr list --label dotnet-release --state open. A leftoverautomation/dotnet-release-watchbranch without one isn't a trigger. - If one is open, copy its snapshot into the worktree: run
git fetch origin automation/dotnet-release-watch, thengit restore --source=FETCH_HEAD -- .github/state/dotnet-releases.json. Commit it with the rest of the run. - If that snapshot is older than the release step 1 found, run the workflow first, with
gh workflow run dotnet-release-watch.yml, and copy the snapshot once it finishes. If it's newer, a release shipped after step 1 ran: run steps 1 and 2 again for that release. - Without a trigger pull request, leave the snapshot alone. Only the workflow writes it. The trigger pull request it opens later holds only the snapshot. It can merge as it is once the refresh pull request has merged, and not before: with the snapshot on
mainand no refresh, the workflow opens no further trigger for that release.
- To find an open trigger pull request, run
-
Update the template files under
templates/: the TFMs in the example projects, and anything else pinned to a version. Then update the three kinds of pin that drift independently of a .NET release:- 4a. The SDK minimum in both
global.jsonfiles. On a major release, move both to that major's first band, such as11.0.100. Between majors, leavesdk.versionalone unless the repository needs something from a newer feature band.- The value is a minimum. With
"rollForward": "latestFeature", it accepts that version or any later band and patch on the machine, so new bands arrive without an edit. - Raising the minimum only narrows who can build. Pinning a patch, such as
11.0.105instead of11.0.100, fails contributors one servicing release behind. - When a band ships something the repository uses, raise the minimum, and give the reason in the pull request. For example,
scripts/uses#:include, which needs SDK10.0.300or later, so the rootglobal.jsoncouldn't go below that band during .NET 10. - Between majors, the two files are independent. The root pin follows what
scripts/needs, and the template pin follows what the example projects need. On a major release, the root moves with the template even whenscripts/doesn't need it, so the repository's own checks run on the release its opinions target. UselatestFeaturewherever the opinion says so. global.jsonhas no comment syntax, so the pinned value is the record.- Renovate never changes this field:
renovate.jsondisables thedotnet-sdkdependency type, because a minimum underlatestFeaturedoesn't need mechanical bumps. Only this skill changes it.
- The value is a minimum. With
- 4b. The package pins in
templates/Directory.Packages.props. Look up every<PackageVersion>on nuget.org, with the registration index (https://api.nuget.org/v3/registration5-gz-semver2/<lowercased-id>/index.json) ordotnet package search <id>.- Take the latest stable version. Never take a prerelease, or a version whose TFM support falls below
targets:. - Before you take a new major version, read its release notes. A major version that changes an idiom an opinion teaches is a content change: handle it in step 5.
- Set the
Versions verified against nuget.org … on <date>comment to the run date whether or not any version changed. It's the file's only freshness record.
- Take the latest stable version. Never take a prerelease, or a version whose TFM support falls below
- 4c. The action pins in
opinions/code blocks. Find everyuses: <owner>/<repo>@<sha> # <version>line in a fenced code block underopinions/, such as the worked example inopinions/ci.md.- Renovate doesn't update a SHA inside Markdown, and a pinned SHA never reports that it's out of date. Readers copy these examples, so this step is the only thing that keeps them current.
- Look up the action's latest stable release with
gh release view --repo <owner>/<repo> --json tagName, then resolve the tag to its commit withgh api repos/<owner>/<repo>/commits/<tag> --jq .sha. Don't take the SHA of an annotated tag object:uses:needs the commit. - Replace the SHA, and set the trailing comment to the release's full version, such as
# v7.0.2. - When an action also runs in this repository's own workflows, as
actions/checkoutandactions/setup-dotnetdo, match the pin in.github/workflows/. Renovate keeps those current, and the opinion says the repository runs them, so the two must agree. - Before you take a new major version, read its release notes. An input, output, or default that the example relies on might have changed. Fix the example in the same edit, and say what changed in the pull request.
- 4a. The SDK minimum in both
-
Update each opinion under
opinions/:- Read the release's "What's new" pages from the first-party sources,
dotnet-blogandms-learn. Read detailed posts on each feature from the rest of the citable roster, such asandrew-lock's "Exploring .NET" series. Readstephen-toub's "Performance Improvements in .NET X" post for the release too, and checkopinions/runtime-performance.mdagainst it: delete any manual optimization that the runtime now does by itself. - Add a new language or runtime feature where it changes an opinion, for example a new syntax that replaces an old idiom.
- When a feature needs a new opinion, create a stub with a
TODOand a source link, and add itsREADME.mdScope bullet and Repository layout entry, which CI enforces. - Update
targets:andlast-reviewed:on every file you change or verify as unchanged. - Never remove or weaken a house block or region (awesome-humans/website: House opinions). If a release makes one obsolete, note inside the block that the release supersedes it, and keep the marking. A template must still build with its house regions removed.
- Read the release's "What's new" pages from the first-party sources,
- If a .NET SDK is available, verify the code samples against the new targets. Run
just build-templates, which assembles the example projects fromtemplates/and runsdotnet build,dotnet test, anddotnet format --verify-no-changeson them. The recipe checks only the templates. To check an opinion's sample, add it to a project's directory in the copy the recipe leaves inartifacts/templates/none/, such assrc/Example.Library/, so that the project compiles it. A file at the root of the copy belongs to no project, and the build passes without it. Then run the same three commands there.dotnet runcalls the test project's entry point directly and skips the SDK's runner selection. It can pass wheredotnet testfails, anddotnet testis whattemplates/,opinions/ci.md, andaudit-freshnessuse.- Treat "0 tests ran, exit code 0" as a failure. It's what a test project reports after losing its runner configuration.
- Without an SDK, flag the samples as unverified in the pull request.
- If the source roster changed, record it in the
AWESOME-HUMANS.mddecision log. Otherwise, summarise the run in the pull request. -
Open a pull request to the default branch, filling in the
version-refresh.mdtemplate, as agents/maintaining.md describes. It lists:- The versions before and after: the framework, the SDK band, each package pin, and each action pin that changed.
- The opinions that changed, and the ones verified as unchanged.
- Whether the samples built and tested.
- Anything left as a TODO.
A person reviews it before it changes any opinion.
If the run copied a trigger pull request's snapshot, end the description with a
Refs: #<number>trailer for it, and comment on the trigger pull request with the refresh pull request's number. The comment says to close the trigger pull request once the refresh merges.After the refresh pull request merges, close the trigger pull request, if it's still open, with
gh pr close <number> --delete-branch. The workflow never closes it: once the snapshot onmainmatches the releases index, the workflow skips its pull request step. If the trigger pull request's snapshot differs from the one onmainby then, a newer release has arrived. Leave it open as the cue for the next run.
Edge cases
- Release timing: A new major .NET version ships every November, with a new C# version. Mid-year releases are servicing releases. They don't change the framework targets, and rarely step 4a, because a new band alone isn't a reason to raise the minimum. A mid-year run that only changes
Directory.Packages.propsis normal. - An unmaintained package: If a package's latest stable release is much older than the current
targets:, the library is probably unmaintained. Leave the pin, and raise it forvet-sourceor opinion review. - Guidance lags the runtime: If a feature is GA but the vetted sources haven't covered it, update the target, and keep the old idiom with a note. Don't write unsourced guidance.
- STS or LTS: Target the latest release on either track. Note its end of support in
opinions/project-structure.md.