forked from BenjaminAbt/Hangfire.ConsoleHost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-steps.dotnet-nuget.yml
67 lines (56 loc) · 1.89 KB
/
azure-pipelines-steps.dotnet-nuget.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Steps of building .NET Core / .NET Standard as NuGet output and raw output
parameters:
gitVersionVersion: ''
nugetVersion: ''
buildConfiguration: ''
packagesToPack: ''
steps:
## Build Versioning
- task: NuGetToolInstaller@0
displayName: NuGet use ${{ parameters.nugetVersion }}
inputs:
versionSpec: ${{ parameters.nugetVersion }}
- task: NuGetCommand@2
displayName: NuGet Install GitVersion
inputs:
command: custom
arguments: install GitVersion.CommandLine -Version ${{ parameters.gitVersionVersion }} -OutputDirectory $(Build.BinariesDirectory)
- powershell: $(Build.BinariesDirectory)\GitVersion.CommandLine.${{ parameters.gitVersionVersion }}\tools\GitVersion.exe $(Build.SourcesDirectory) /output buildserver /nofetch
displayName: GitVersion Execute
- powershell: |
$CI_Version = "$env:GITVERSION_LEGACYSEMVER"
Write-Host ("##vso[task.setvariable variable=CI_Version;]$CI_Version")
Write-Host "Build ID: $(Build.BuildId)"
Write-Host "Build BuildNumber: $(Build.BuildNumber)"
displayName: "Build Versionize"
## Build Versioning
- task: NuGetCommand@2
displayName: "NuGet Restore"
inputs:
restoreSolution: '**/*.csproj'
feedsToUse: config
nugetConfigPath: NuGet.config
- task: DotNetCoreCLI@2
displayName: ".NET build"
inputs:
projects: '**/*.csproj'
arguments: --configuration ${{ parameters.buildConfiguration }} --no-restore
- task: DotNetCoreCLI@2
displayName: ".NET test"
inputs:
command: test
projects: 'test/**/*.csproj'
- task: DotNetCoreCLI@2
displayName: ".NET pack"
inputs:
command: pack
packagesToPack: ${{ parameters.packagesToPack }}
versioningScheme: byEnvVar
versionEnvVar: CI_Version
arguments: --no-build
- task: PublishBuildArtifacts@1
displayName: "Publish artifacts"
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)
ArtifactName: drop
ArtifactType: Container