This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipelines.yml
71 lines (66 loc) · 2.4 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
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
68
69
70
71
# 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
trigger:
- master
pr:
- master
variables:
buildConfiguration: 'Release'
stages:
- stage: "Prepare"
displayName: "Build and test"
jobs:
- job: "Build"
strategy:
matrix:
Linux:
imageName: 'ubuntu-latest'
Windows:
imageName: 'windows-latest'
steps:
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- script: dotnet test -v n --configuration $(buildConfiguration) -l trx
displayName: 'dotnet test $(buildConfiguration)'
- script: dotnet pack --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)
condition: and(succeeded(), eq(variables.imageName, 'ubuntu-latest'))
displayName: 'dotnet pack $(buildConfiguration)'
- task: PublishBuildArtifacts@1
condition: and(succeeded(), eq(variables.imageName, 'ubuntu-latest'))
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: pack
- stage: "Release"
dependsOn: "Prepare"
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/release'))
jobs:
# - job: "GitHubRelease"
# displayName: "GitHub Release"
# steps:
# - task: GitHubRelease@1
# displayName: 'GitHub release (create)'
# inputs:
# gitHubConnection: ctolkien
# tagSource: userSpecifiedTag
# tag: '$(Build.BuildNumber)'
# title: '$(Build.BuildNumber)'
# assets: '**/*.nupkg'
# changeLogCompareToRelease: lastNonDraftRelease
- deployment: "NugetPublish"
displayName: "Publish to Nuget"
environment: "NuGet"
pool:
vmImage: 'windows-2019'
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
displayName: "Push to NuGet"
inputs:
command: 'push'
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg;'
nuGetFeedType: 'external'
publishFeedCredentials: 'NuGet'