-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
azure-pipelines.yml
56 lines (47 loc) · 1.56 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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
# Windows image required for code coverage -> https://github.com/Microsoft/vstest-docs/blob/master/docs/analyze.md#coverage
vmImage: 'windows-latest'
steps:
- task: PowerShell@2
name: GitVersion
displayName: run gitversion
inputs:
targetType: 'inline'
script: |
Write-Host "Installing GitVersion..."
choco install gitversion.portable --no-progress
Write-Host "Executing GitVersion..."
$Env:SemVer = gitversion /showvariable SemVer
Write-Host "SemVer: $Env:Semver"
echo "##vso[task.setvariable variable=SemVer;isOutput=true]$Env:SemVer"
echo "##vso[build.updatebuildnumber]$Env:SemVer+$(Build.BuildId)"
- task: DotNetCoreCLI@2
displayName: dotnet test
inputs:
command: 'test'
projects: 'BencodeNET.sln'
arguments: '--configuration Release --collect "Code coverage"'
testRunTitle: 'BencodeNET.Tests'
- task: DotNetCoreCLI@2
displayName: dotnet pack
inputs:
command: 'pack'
packagesToPack: 'BencodeNET/*.csproj'
configuration: 'Release'
packDirectory: '$(Pipeline.Workspace)/Packages'
nobuild: true
versioningScheme: 'off'
buildProperties: 'SemVer=$(GitVersion.SemVer)'
verbosityPack: 'Normal'
- task: PublishPipelineArtifact@1
displayName: Publish artifacts
inputs:
targetPath: '$(Pipeline.Workspace)\Packages'
artifact: 'Packages'
publishLocation: 'pipeline'