Skip to main content

The package component builds and optionally publishes packages from a project directory.

.NET packages

.NET projects are handled with type: dotnet. Auto detection selects dotnet when the package path contains a .csproj file or packages.config.

For GitLab package registry restores, the component configures a NuGet package source named GitLab. If you provide your own NuGet.Config, use the same source name:

<packageSources>
<clear />
<add key="GitLab" value="https://gitlab.com/api/v4/projects/<project-id>/packages/nuget/index.json" />
</packageSources>

Credentials for that source are read from the standard NuGet environment variable NuGetPackageSourceCredentials_GitLab. When it is not set, the component fills it from CI_JOB_TOKEN for GitLab CI restores. Publishing uses NUGET_API_KEY when available and otherwise falls back to CI_JOB_TOKEN.

Inputs

NameDescriptionDefaultType
------------
imageBuilder image to use for the build package jobs. Like a S2I Image from the Red Hat Catalog.string
nameName for the package/project.${CI_PROJECT_NAME}string
needsThe jobs that this job depends on.[]array
pathShould the pipeline fail if the test fails?.string
registrySelects the registry to use for the package.projectstring
remote-registry-tokenThe authentication token for the remote registry.string
remote-registry-urlThe URL of the remote registry to use for the package.string
remote-registry-userThe username for the remote registry.string
rulesThe jobs that this job depends on.[{"if":"$CI_PIPELINE_SOURCE == \"schedule\"","when":"never"},{"if":"$CI_PIPELINE_SOURCE == \"merge_request_event\"","when":"never"},{"when":"on_success"}]array
scanning-allow-failureShould the pipeline fail if scanning the built package fails?trueboolean
scanning-enabledShould the package be scanned?trueboolean
scanning-severityWhat level of severity should cause scanning of the built package to fail?CRITICALstring
stageThe pipeline stage that the job will belong to.buildstring
tagsThe runners that this job depends on.[]array
typeautostring