-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure-pipelines.yml
39 lines (31 loc) · 1.32 KB
/
azure-pipelines.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
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
pool:
vmImage: 'windows-2022'
variables:
buildConfiguration: 'Release'
steps:
# Restore, build, & pack the projects
- script: dotnet pack --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory) -p:ContinuousIntegrationBuild=true
displayName: 'Build $(buildConfiguration)'
- task: DotNetCoreCLI@2
inputs:
command: test
projects: '*Test/*.csproj'
arguments: '--configuration $(buildConfiguration) --logger nunit --framework netcoreapp3.1 --collect "Code coverage"'
displayName: 'Test .NET Core 3.1'
- task: DotNetCoreCLI@2
inputs:
command: test
projects: '*Test/*.csproj'
arguments: '--configuration $(buildConfiguration) --logger nunit --framework netcoreapp6.0 --collect "Code coverage"'
displayName: 'Test .NET Core 6.0'
- task: NuGetToolInstaller@1
- task: PowerShell@2
inputs:
targetType: 'inline'
script: 'nuget push $(Build.ArtifactStagingDirectory)\*.nupkg -ApiKey $(NugetApiKey) -Source https://api.nuget.org/v3/index.json'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'NuGet Push'