88- develop
99- rel/*
1010
11- pool :
12- vmImage : windows-latest
13-
14- variables :
15- BuildConfiguration : Release
16- DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
17-
18- steps :
19- - task : UseDotNet@2
20- displayName : ' Use .NET Core SDK 3.1.x'
21- inputs :
22- version : 3.1.302
23- performMultiLevelLookup : true
24-
25- - task : DotNetCoreCLI@2
26- inputs :
27- command : custom
28- custom : tool
29- arguments : install --tool-path . nbgv
30- displayName : Install NBGV tool
31-
32- - script : nbgv cloud
33- displayName : Set Version
34-
35- - task : MSBuild@1
36- displayName : ' Build solution Kerberos.NET.sln'
37- inputs :
38- solution : Kerberos.NET.sln
39- configuration : $(BuildConfiguration)
40- msbuildArguments : /restore /p:CreatePackage=true
41- maximumCpuCount : true
42-
43- - task : DotNetCoreCLI@2
44- inputs :
45- command : test
46- projects : Tests/**/*.csproj
47- arguments : -c $(BuildConfiguration) --no-build --no-restore --settings CodeCoverage.runsettings --collect:"XPlat Code Coverage"
48- displayName : Run Unit Tests
49-
50- - task : DotNetCoreCLI@2
51- inputs :
52- command : ' pack'
53- packagesToPack : ' ./Bruce/Bruce.csproj'
54- nobuild : true
55- displayName : Pack Bruce tool
11+ stages :
12+ - stage : Build
13+ jobs :
14+ - job : Build
15+ pool :
16+ vmImage : windows-latest
17+
18+ variables :
19+ BuildConfiguration : Release
20+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
21+
22+ steps :
23+ - task : UseDotNet@2
24+ displayName : ' Use .NET Core SDK 3.1.x'
25+ inputs :
26+ version : 3.1.302
27+ performMultiLevelLookup : true
28+
29+ - task : DotNetCoreCLI@2
30+ inputs :
31+ command : custom
32+ custom : tool
33+ arguments : install --tool-path . nbgv
34+ displayName : Install NBGV tool
35+
36+ - script : nbgv cloud
37+ displayName : Set Version
38+
39+ - task : MSBuild@1
40+ displayName : ' Build solution Kerberos.NET.sln'
41+ inputs :
42+ solution : Kerberos.NET.sln
43+ configuration : $(BuildConfiguration)
44+ msbuildArguments : /restore /p:CreatePackage=true
45+ maximumCpuCount : true
46+
47+ - task : DotNetCoreCLI@2
48+ inputs :
49+ command : test
50+ projects : Tests/**/*.csproj
51+ arguments : -c $(BuildConfiguration) --no-build --no-restore --settings CodeCoverage.runsettings --collect:"XPlat Code Coverage"
52+ displayName : Run Unit Tests
53+
54+ - task : DotNetCoreCLI@2
55+ inputs :
56+ command : ' pack'
57+ packagesToPack : ' ./Bruce/Bruce.csproj'
58+ nobuild : true
59+ outputDir : $(Build.ArtifactStagingDirectory)
60+ displayName : Pack Bruce tool
5661
57- - task : PublishBuildArtifacts@1
58- inputs :
59- PathtoPublish : ' $(Build.ArtifactStagingDirectory)'
60- publishLocation : ' Container'
61-
62- - task : DotNetCoreCLI@2
63- inputs :
64- command : custom
65- custom : tool
66- arguments : install --tool-path . dotnet-reportgenerator-globaltool
67- displayName : Install ReportGenerator tool
68-
69- - script : reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"
70- displayName : Create reports
71-
72- - task : PublishCodeCoverageResults@1
73- displayName : ' Publish code coverage'
74- inputs :
75- codeCoverageTool : Cobertura
76- summaryFileLocation : $(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml
77-
78- - task : NuGetAuthenticate@0
79- displayName : ' NuGet Authenticate'
80- - task : NuGetCommand@2
81- displayName : ' NuGet push'
82- inputs :
83- command : push
84- publishVstsFeed : ' Kerberos.NET/kerberos.net'
85- allowPackageConflicts : true
86-
87- - publish : artifacts
88- displayName : Publish build packages
89- artifact : BuildPackages
62+ - task : PublishBuildArtifacts@1
63+ inputs :
64+ PathtoPublish : ' $(Build.ArtifactStagingDirectory)'
65+ publishLocation : ' Container'
66+
67+ - task : DotNetCoreCLI@2
68+ inputs :
69+ command : custom
70+ custom : tool
71+ arguments : install --tool-path . dotnet-reportgenerator-globaltool
72+ displayName : Install ReportGenerator tool
73+
74+ - script : reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"
75+ displayName : Create reports
76+
77+ - task : PublishCodeCoverageResults@1
78+ displayName : ' Publish code coverage'
79+ inputs :
80+ codeCoverageTool : Cobertura
81+ summaryFileLocation : $(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml
82+
83+ - task : NuGetAuthenticate@0
84+ displayName : ' NuGet Authenticate'
85+ - task : NuGetCommand@2
86+ displayName : ' NuGet push'
87+ inputs :
88+ command : push
89+ publishVstsFeed : ' Kerberos.NET/kerberos.net'
90+ allowPackageConflicts : true
91+
92+ - publish : artifacts
93+ displayName : Publish build packages
94+ artifact : BuildPackages
95+
96+ - publish : config
97+ displayName : Publish Signing Scripts
98+ artifact : config
99+
100+ - stage : CodeSign
101+ # condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest')))
102+ jobs :
103+ - deployment : CodeSign
104+ displayName : Code Signing
105+ pool :
106+ vmImage : windows-latest
107+ environment : Code Sign - Approvals
108+ variables :
109+ - group : Sign Client Credentials
110+ strategy :
111+ runOnce :
112+ deploy :
113+ steps :
114+ # If you have MSCA: https://aka.ms/mscadocs
115+ # - task: ms-codeanalysis.vss-microsoft-security-code-analysis-devops.build-task-antimalware.AntiMalware@3
116+ # displayName: AntiMalware Scan
117+ # inputs:
118+ # EnableServices: true
119+ # FileDirPath: $(Pipeline.Workspace)\BuildPackages
120+
121+ - task : DotNetCoreCLI@2
122+ inputs :
123+ command : custom
124+ custom : tool
125+ arguments : install --tool-path . SignClient
126+ displayName : Install SignTool tool
127+
128+ - pwsh : |
129+ .\SignClient "Sign" `
130+ --baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
131+ --input "**/*.nupkg" `
132+ --config "$(Pipeline.Workspace)\config\SignClient.json" `
133+ --filelist "$(Pipeline.Workspace)\config\filelist.txt" `
134+ --user "$(SignClientUser)" `
135+ --secret '$(SignClientSecret)' `
136+ --name "Kerberos.NET" `
137+ --description "Kerberos.NET" `
138+ --descriptionUrl "https://github.com/dotnet/Kerberos.NET"
139+ displayName: Sign Kerberos.NET
140+
141+ - pwsh : |
142+ .\SignClient "Sign" `
143+ --baseDirectory "$(Pipeline.Workspace)\drop" `
144+ --input "**/*.nupkg" `
145+ --config "$(Pipeline.Workspace)\config\SignClient.json" `
146+ --filelist "$(Pipeline.Workspace)\config\filelist.txt" `
147+ --user "$(SignClientUser)" `
148+ --secret '$(SignClientSecret)' `
149+ --name "Bruce" `
150+ --description "Commandline client for Kerberos.NET" `
151+ --descriptionUrl "https://github.com/dotnet/Kerberos.NET"
152+ displayName: Sign Bruce
153+
154+ - publish : $(Pipeline.Workspace)/BuildPackages
155+ displayName : Publish Signed Packages
156+ artifact : SignedPackages
157+
158+ - publish : $(Pipeline.Workspace)/Drop
159+ displayName : Publish Signed Drop
160+ artifact : SignedDrop
0 commit comments