This repository has been archived by the owner on Jul 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipelines.yml
86 lines (70 loc) · 2.11 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
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/vsts/pipelines/apps/windows/dot-net
trigger:
- master
- rel/*
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
project: '**/MpesaLib.csproj'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
nugetVersion: '5.2.0' # https://dist.nuget.org/tools.json
steps:
- task: UseDotNet@2
displayName: 'Use dotnet sdk 3.1.201'
inputs:
version: 3.1.201
includePreviewVersions: true
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
- script: nbgv cloud
displayName: Set Version
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
- task: NuGetToolInstaller@1
inputs:
versionSpec: $(nugetVersion)
checkLatest: true
- task: NuGetCommand@2
inputs:
command: restore
restoreSolution: '$(solution)'
displayName: Nuget Restore
- task: DotNetCoreCLI@2
inputs:
command: build
projects: $(solution)
arguments: -c $(BuildConfiguration)
displayName: Build
- powershell: |
mkdir $(Build.ArtifactStagingDirectory)\Packages
$version = .\nbgv get-version -f json | ConvertFrom-Json
displayName: Create package folder
- task: DotNetCoreCLI@2
inputs:
command: pack
arguments: -c $(BuildConfiguration)
packagesToPack: '**/MpesaLib.csproj'
versioningScheme: byBuildNumber
packDirectory: '$(Build.ArtifactStagingDirectory)\Packages'
displayName: Dotnet Pack
- task: PublishBuildArtifacts@1
displayName: Publish Package Artifacts
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)\Packages
artifactType: container
artifactName: Packages
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
- powershell: |
choco install docfx -y
docfx docfx_project/docfx.json
if ($lastexitcode -ne 0){
throw ("Error generating document")
}
displayName: "docfx documentation build"