actions-marketplace-validations/Publish to NuGet
Automatic project detection, multi-package support, better error detection and improved logging. Drop-in replacement for publish-nuget clones.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| NUGET_KEY | NuGet API key to authenticate on the NuGet server. DO NOT PUT THE KEY DIRECTLY HERE. Use GitHub Secrets (e.g., dollarsign{{secrets.YOUR_NUGET_API_KEY}}) instead. | yes | — |
| PROJECT_FILE_PATH | Full path to a project file or a JSON array of project file paths. (Examples: `src/MyNuGetProject/MyNuGetProject.csproj` or `["src/Project1/Project1.csproj", "src/Project2/Project2.csproj"]`). If not specified, the action will auto-discover a project (or projects, if PUBLISH_ALL_PROJECTS is true) that contains `<GeneratePackageOnBuild>true</GeneratePackageOnBuild>`. | no | — |
| PUBLISH_ALL_PROJECTS | If set to true, the action ignores PROJECT_FILE_PATH and auto-discovers and publishes all projects with `<GeneratePackageOnBuild>true</GeneratePackageOnBuild>`. | no | false |
| SOLUTION_FILE_PATH | Path to solution to build. | no | "" |
| NUGET_SOURCE | URL to the NuGet server. (Default: https://api.nuget.org) | no | https://api.nuget.org |
| INCLUDE_SYMBOLS | Add symbols to the NuGet package. (Default: false) | no | false |
| TAG_COMMIT | Tag the current Git commit upon successful upload. (This will prevent publish if the tag already exists.) (Default: false) | no | false |
| TAG_FORMAT | Git tag format. Use * as a placeholder for the version number. (Default: v*) | no | v* |
| PACKAGE_NAME | NuGet package name used for checking if the package version already exists on the NuGet server. (Default: extracted from PROJECT_FILE_PATH) | no | — |
| VERSION_FILE_PATH | Path to the file containing the version number to extract using regex. (Default: same as PROJECT_FILE_PATH) | no | — |
| VERSION_REGEX | Regex pattern with a capturing group to extract version info. (Default: ^\s*<Version>\s*(.*?)\s*<\/Version>\s*$) | no | ^\s*<Version>\s*(.*?)\s*<\/Version>\s*$ |
| VERSION_STATIC | Provide a static version instead of extracting from a file. Overrides VERSION_FILE_PATH and VERSION_REGEX. (e.g., dollarsign{{env.GitBuildVersionSimple}}) | no | — |
| REBUILD_PROJECT | Rebuild the project in release mode before packaging. (Default: true) | no | true |
| LOG_LEVEL | Log level for debugging (DEBUG, INFO, WARN). (Default: DEBUG) | no | DEBUG |
Outputs
| name | description |
|---|---|
| VERSION | Version of the associated git tag (if TAG_COMMIT is true). |
| PACKAGE_NAME | Name of the generated NuGet package. |
| PACKAGE_PATH | Path to the generated NuGet package. |
| SYMBOLS_PACKAGE_NAME | Name of the generated symbols package (if INCLUDE_SYMBOLS is true). |
| SYMBOLS_PACKAGE_PATH | Path to the generated symbols package (if INCLUDE_SYMBOLS is true). |