-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
azure-pipelines.yml
71 lines (58 loc) · 1.84 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
# Build pipeline
trigger:
- master
- refs/tags/*
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.csproj'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
BuildVersion: 0
steps:
- task: PowerShell@2
displayName: 'Set Build Version'
inputs:
targetType: 'inline'
script: |
$timestamp = git log -1 --pretty="format:%ct"
Write-Host "Build Version: $timestamp"
Write-Host "##vso[task.setvariable variable=BuildVersion]$($timestamp)"
$isTag = [regex]::IsMatch($Env:BUILD_SOURCEBRANCH, "^(refs\/tags\/)")
Write-Host "##vso[task.setvariable variable=isTag]$($isTag)"
- task: CmdLine@2
inputs:
script: 'set'
#- task: PowerShell@2
# displayName: 'Version Info'
# inputs:
# targetType: 'inline'
# script: |
# $version = (Select-Xml -Path ".\package.props" -XPath "/Project/PropertyGroup/VersionBase" | Select-Object -ExpandProperty Node).InnerText
# $timestamp = git log -1 --pretty="format:%ct"
# Write-Host "Version: $version"
# Write-Host "Time Stamp: $timestamp"
# Write-Host "##vso[task.setvariable variable=STAGE_VERSION]$($version)-$($timestamp)"
- task: NuGetToolInstaller@1
displayName: 'Install NuGet'
- task: NuGetCommand@2
displayName: 'Restore Dependencies'
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
displayName: 'Build'
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
displayName: 'Test'
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
searchFolder: '$(system.defaultworkingdirectory)\test'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(system.defaultworkingdirectory)\src\bin\$(buildPlatform)\$(buildConfiguration)'
ArtifactName: 'Binaries'