-
Notifications
You must be signed in to change notification settings - Fork 32
/
azure-pipelines.yml
105 lines (91 loc) · 3.14 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
96
97
98
99
100
101
102
103
104
105
trigger:
branches:
include:
- master
paths:
exclude: ["doc", "*.md"]
variables:
# TreatWarningsAsErrors: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BuildConfiguration: Release
BuildPlatform: Any CPU
jobs:
- job: Windows
pool: Hosted Windows 2019 with VS2019
steps:
- script: |
dotnet tool install --tool-path . nbgv
.\nbgv cloud -p src
displayName: Set build number
condition: ne(variables['system.pullrequest.isfork'], true)
- task: UseDotNet@2
displayName: Install .NET Core SDK
inputs:
version: 2.2.401
- script: dotnet --info
displayName: Show dotnet SDK info
- task: DotNetCoreCLI@2
displayName: Restore NuGet packages
inputs:
command: restore
verbosityRestore: normal # detailed, normal, minimal
projects: src/**/*.sln
feedsToUse: config
nugetConfigPath: src/NuGet.Config
# Use VSBuild on Windows so GitLink will work (it fails on dotnet build)
- task: VSBuild@1
inputs:
vsVersion: "16.0"
msbuildArgs: /t:build,pack /m /v:m /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog"
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
displayName: Build Visual Studio solution
- task: DotNetCoreCLI@2
displayName: Run tests
inputs:
command: test
projects: src/ImmutableObjectGraph.Generation.Tests
configuration: $(BuildConfiguration)
nobuild: true
- task: CopyFiles@1
inputs:
Contents: |
obj/**/project.assets.json
TargetFolder: $(Build.ArtifactStagingDirectory)/projectAssetsJson
displayName: Collecting project.assets.json artifacts
condition: succeededOrFailed()
- task: CopyFiles@1
inputs:
Contents: |
bin/Packages/$(BuildConfiguration)/*.nupkg
TargetFolder: $(Build.ArtifactStagingDirectory)/deployables
flattenFolders: true
displayName: Collecting deployables
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/projectAssetsJson
ArtifactName: projectAssetsJson
ArtifactType: Container
displayName: Publish projectAssetsJson artifacts
condition: and(succeededOrFailed(), ne(variables['system.pullrequest.isfork'], true))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/build_logs
ArtifactName: build_logs
ArtifactType: Container
displayName: Publish build_logs artifacts
condition: and(succeededOrFailed(), ne(variables['system.pullrequest.isfork'], true))
## The rest of these steps are for deployment and skipped for PR builds
#- task: PublishBuildArtifacts@1
# inputs:
# PathtoPublish: $(build.sourcesdirectory)/bin
# ArtifactName: bin
# ArtifactType: Container
# condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/deployables
ArtifactName: deployables
ArtifactType: Container
displayName: Publish deployables artifacts
condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true))