简体中文 | English · Back to README
The 17 Fast.NET NuGet packages are independently versioned. Publishing is an irreversible external action and must run only after maintainer review and explicit confirmation.
- Update
<Version>in every affected project. - Update
CHANGELOG.md, READMEs, and module documentation. - Confirm that
Directory.Packages.propsversions match their target frameworks. - Build and pack all SDK projects:
UploadNuget.bat packThe batch file restores the solution, runs dotnet build, and runs dotnet pack only after the build succeeds. pack mode stops without publishing.
All .nupkg and .snupkg files are written to nupkgs/. Existing files aren't recursively deleted. The batch file identifies the current package for each project's PackageId and PackageVersion, so old package versions in the directory aren't selected for publishing.
Before publishing, inspect at least:
- Package name, version, description, license, repository URL, and dependency versions in the
.nuspec. Fast.IaaScontains onlylib/netstandard2.1.- Every other package contains
lib/net8.0,lib/net9.0, andlib/net10.0. - Each target contains both the assembly and XML API documentation.
- Symbols use the
.snupkgformat.
Set NUGET_API_KEY in the current environment before publishing. NUGET_SOURCE is optional and defaults to NuGet.org.
UploadNuget.bat publish-all
UploadNuget.bat publish-one Fast.Cachepublish-all builds, packs, and publishes all 17 current packages. publish-one builds and packs everything, then publishes only the specified package ID. Running UploadNuget.bat without arguments opens the interactive configuration and package-selection menu, where another package can be selected after a single-package push. The script lists the selected packages and source before calling dotnet nuget push.
The script checks both the NuGet exit code and diagnostic output. With --skip-duplicate, an existing package can return exit code 0, so that code alone does not count as a successful publication. The script scopes DOTNET_CLI_UI_LANGUAGE=zh-CN to its process. When PowerShell is available, it forces redirected NuGet output to UTF-8, classifies Chinese and English success, duplicate-package, warning, and error diagnostics, then converts the log to CMD CP936 for display. When PowerShell is unavailable, NuGet writes directly to the console; a nonzero exit code is a failure, while a zero exit code is conservatively reported as a warning because the detailed result cannot be classified reliably.
| Result | Color | Meaning |
|---|---|---|
| Success | Green | Exit code 0 with an explicit publication confirmation and no warnings, errors, or duplicate messages |
| Already exists, skipped | Dark gray | Exit code 0 with only existing versions skipped; excluded from the success count |
| Warning | Yellow | A warning, mixed success and skips across the package and its symbols, or an unconfirmed overall result |
| Failure | Red | A nonzero exit code or an error diagnostic, even if the command returns 0 |
The summary counts each push attempt as success, skip, warning, or failure and lists packages requiring attention. The script returns 0 for success or skips only, 2 for warnings without failures, and 1 if any attempt fails. Ending an interactive session also shows the summary when its only results were skips or warnings.
The summary groups counts and package names by result, using the corresponding color and one package per line, including successful packages. System PowerShell applies colors through the console API and restores the original color afterward. Redirected output and systems without PowerShell use plain text without generated ANSI escape sequences.
Never store an API key in the repository, scripts, logs, shell history, or issues. Clear the process environment variable after publishing, then verify package metadata, README rendering, dependencies, and symbol status on NuGet.org.