Skip to main content

NuGet Package - GitLab

Overview

The NuGet Package - GitLab template streamlines the NuGet package creation and publishing process. It identifies and builds projects in their .csproj files. The script includes a placeholder scan and test execution. During the packaging phase, it dynamically determines the patch version using "dotnet-gitversion" for version consistency, sets the package version accordingly, and publishes the NuGet package to the specified GitLab repository. The template ensures smooth integration of versioning and packaging into the GitLab CI/CD workflow.

Input Variables

Input Variable NameDescriptionDefault ValuesTypeSupported Values
pipeline_number_prefixPrefix for the pipeline number.${version_prefix}string
pre_release_tagPre-release tag to append to the package version.alphastring
gl_package_tokenGitLab package token for authentication.myGitLabTokenstring
gl_package_usernameGitLab package username for authentication.myGitLabUserstring
gl_package_pathPath to the GitLab package repository.https://gitlab.example.com/api/packages/nuget/index.jsonstring
version_prefixPrefix for the package version.1.0string
gl_urlGitLab instance URL.gitlab.comstring
gl_tokenGitLab personal access token for authentication.myPersonalAccessTokenstring
gl_usernameGitLab username for authentication.myGitLabUserstring
gl_projectidGitLab project ID for the NuGet package repository.123456number
app_nameName of the application.myapplicationstring