Please follow the below steps after publishing analyzer NuGet packages from this repo onto NuGet.org:
- Create a new release OR Update an existing draft release:
- Draft: Either click here to draft a new release OR update an existing draft release. For reference, you can look at any of the existing releases, say v2.9.3.
- Release notes: Follow the steps in the Steps to generate Release Notes below to generate Release notes and copy the generated notes to the description section of the new release.
- Publish: Mark the release as a pre-release if appropriate and click "Publish Release".
- Repo changes:
- Checkout a new branch from latest sources of release branch.
- Update
VERSIONING.md
: Add a new row in the released version table. - Update
.github\ISSUE_TEMPLATE\bug-report.md
: Update the package version in the example section to the latest released package version. - Update
eng\Versions.props
:- Bump up the
VersionPrefix
. If the new version prefix is greater then or equals the currentAnalyzerUtilitiesVersionPrefix
, then updateAnalyzerUtilitiesVersionPrefix
to$(VersionPrefix)
. - Reset
PreReleaseVersionLabel
tobeta1
. - Update
DogfoodNetAnalyzersVersion
and/orDogfoodAnalyzersVersion
to the latest released package version.
- Bump up the
- Build the repo by invoking
eng\common\CIBuild.cmd
and fix/suppress any new CA diagnostics, as appropriate. This should also update the analyzer documentation files in the repo to use the new version prefix. - Move all the entries from
AnalyzerReleases.Unshipped.md
toAnalyzerReleases.Shipped.md
for various analyzer NuGet package projects under a new "Release" section in the shipped file. - Create and submit a PR with the above changes.
-
Go to the the NuGet page of Microsoft.CodeAnalysis.NetAnalyzers.
-
Click on the Versions tab and select the version for which you want to create a tag and release notes, then download the nupkg. For this example, we are going to use 7.0.4.
-
Open the downloaded NuGet package as a zip, then open the
Microsoft.CodeAnalysis.NetAnalyzers.nuspec
file at the root. -
Copy the commit
hash
located in the<repository>
entry at the end of the nuspec file. -
In your local roslyn-analyzers clone, fetch and checkout the latest bits in main (or the
release/X.Y.Zxx
branch if main does not contain that hash). -
Checkout the commit hash you copied:
git checkout <hash>
. -
Execute
git tag X.Y.Z
to create a new local tag, whereX.Y.Z
represents the package version. For this example, it's:git tag 7.0.4
. -
Make sure you have permissions to push to dotnet/roslyn-analyzers.
-
Assuming your dotnet/roslyn-analyzers remote is named
upstream
, executegit push upstream X.Y.Z
. For example:git push upstream 7.0.4
. -
Go to the dotnet/roslyn-analyzers GitHub page. On the right sidebar, click on Releases. Then click on the "Draft a new release" button.
-
Click on the "Choose a tag" dropdown menu and select the tag you just pushed,
7.0.4
. The dropdowns will now change. -
Click on the "Previous tag: auto" dropdown menu that just showed up and select the version that was released before your chosen tag. For this example, the previous version was
7.0.3
. -
Click on the "Generate release notes" button so GitHub autogenerates the "What's changed" and "Full Changelog" texts for you.
-
Prepend the following text at the beginning of that generated text:
Release build of [Microsoft.CodeAnalysis.NetAnalyzers CURRENT-VERSION](https://www.nuget.org/packages/Microsoft.CodeAnalysis.NetAnalyzers/CURRENT-VERSION) containing first-party [code quality analyzers ("CAxxxx rules")](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/overview#code-quality-analysis). Contains bug fixes on top of [PREVIOUS-VERSION](https://github.com/dotnet/roslyn-analyzers/releases/tag/PREVIOUS-VERSION) release.
-
Make sure to change all the
CURRENT-VERSION
placeholders to the current tag value (7.0.4
in this example), and all thePREVIOUS-VERSION
placeholders to the previous tag value (7.0.3
in this example). -
If necessary, check the "Set as the latest release" and/or "Set as a pre-release" checkboxes.
-
Click on "Publish release".
-
The new release should now show up under dotnet/roslyn-analyzers/releases
- For
Microsoft.CodeAnalysis.Analyzers
package, updateMicrosoftCodeAnalysisAnalyzersVersion
in dotnet/roslyn to reference the new package version. - For
Roslyn.Diagnostics.Analyzers
package, updateRoslynDiagnosticsNugetPackageVersion
in dotnet/roslyn to reference the new package version.