This repository has been archived by the owner on Nov 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathazure-pipelines.yml
95 lines (82 loc) · 3.09 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
stages:
- stage: Master
jobs:
- job: Build1
displayName: 'Build & Test'
pool:
vmImage: 'windows-latest'
steps:
- task: NuGetToolInstaller@1
displayName: 'Install NuGet'
- task: NuGetCommand@2
displayName: Restore NuGet Packages
inputs:
restoreSolution: '$(solution)'
- task: DotNetCoreCLI@2
displayName: Build Solution
inputs:
command: build
projects: '$(solution)'
arguments: '--configuration $(buildConfiguration) /p:SourceLinkCreate=true /p:IncludeSymbols=true /p:IncludeSource=true /v:n'
- task: DotNetCoreCLI@2
displayName: Run Unit Tests
inputs:
command: test
arguments: '--no-build --configuration $(BuildConfiguration) --logger:trx /p:CollectCoverage=true /p:CollectCoverage=true /p:CoverletOutputFormat=opencover'
projects: 'tests/**/*.csproj'
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage'
- script: |
dotnet pack radius-net --no-build --include-symbols --include-source --configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)
displayName: Generate NuGet Packages
- task: PublishBuildArtifacts@1
displayName: Publish build Artifacts
inputs:
artifactName: nuget
- stage: NuGet
displayName: Upload to NuGet.org
dependsOn: Master
condition: and(succeeded('Master'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- job: NuGet1
displayName: Upload
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: current
downloadPath: '$(Build.ArtifactStagingDirectory)'
artifactName: nuget
- task: NuGetCommand@2
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'NuGet thomas@caudal.fr'
- task: GitHubRelease@0
displayName: Create GitHub Release
inputs:
gitHubConnection: frblondin-github
repositoryName: '$(Build.Repository.Name)'
isPreRelease: false
tagSource: manual
tag: $(Build.BuildNumber)
assets: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'