-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpush-nuget-package.yml
31 lines (29 loc) · 1.09 KB
/
push-nuget-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Repo: FirelyTeam/azure-pipeline-templates
# File: push-nuget-package.yml
parameters:
artifact: # The name of the artifact to download
source: # NuGet Source, like https://nuget.pkg.github.com/FirelyTeam/index.json
apiKey: # The api key to be used for pushing packages to the NuGet server
steps:
- powershell: |
if ($Env:AGENT_OS -eq "Windows_NT") {$sep = "\"} else {$sep = "/"}
echo "##vso[task.setvariable variable=PATH_SEPARATOR]$sep"
- download: none
- task: DownloadPipelineArtifact@2
inputs:
source: current
artifact: ${{ parameters.artifact }}
path: $(Build.ArtifactStagingDirectory)$(PATH_SEPARATOR)${{ parameters.artifact }}
- task: NuGetToolInstaller@1
inputs:
versionSpec: 5.x
- task: DotNetCoreCLI@2
displayName: Push packages to NuGet server
inputs:
command: custom
custom: nuget
arguments: >
push $(Build.ArtifactStagingDirectory)$(PATH_SEPARATOR)${{ parameters.artifact }}$(PATH_SEPARATOR)*.nupkg
--source ${{ parameters.source }}
--api-key ${{ parameters.apiKey }}
--skip-duplicate