This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure-pipelines.yml
71 lines (71 loc) · 2.52 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
name: $(Rev:r)
jobs:
- job: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- powershell: |
$buildId = $env:BUILD_BUILDNUMBER.PadLeft(7, '0');
$versionSuffixPR = "ci-$buildId-pr$($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)";
$branchName = "$env:BUILD_SOURCEBRANCHNAME".Replace("_","");
$versionSuffixBRANCH = "ci-$buildId";
$isTag = "$env:BUILD_SOURCEBRANCH".StartsWith('refs/tags/');
$isPR = "$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" -ne ""
$versionSuffix = if ($isTag) { "" } else { if ($isPR) { $versionSuffixPR } else { $versionSuffixBRANCH } };
Write-Host "##vso[task.setvariable variable=VersionSuffix]$versionSuffix";
- script: build.cmd -t RunTests
displayName: Run tests
env:
VersionSuffix: '$(VersionSuffix)'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()
- script: build.cmd -t Nuget
displayName: Create package
env:
VersionSuffix: '$(VersionSuffix)'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'bin/nupkg'
artifactName: 'nupkgs'
- task: NuGetCommand@2
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'Jet-MyGet'
versioningScheme: byEnvVar
versionEnvVar: Version
packagesToPush: _none
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: echo "##vso[task.setvariable variable=FrameworkPathOverride]$(dirname $(which mono))/../lib/mono/4.5/"
displayName: Workaround .NET reference assemblies on linux
- script: dotnet pack build.proj -v n
displayName: Create package
- script: dotnet test build.proj -v n
displayName: Run tests
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()
- job: MacOS
pool:
vmImage: 'macOS-10.13'
steps:
- script: echo "##vso[task.setvariable variable=FrameworkPathOverride]$(dirname $(which mono))/../lib/mono/4.5/"
displayName: Workaround .NET reference assemblies on linux
- script: dotnet pack build.proj -v n
displayName: Create package
- script: dotnet test build.proj -v n
displayName: Run tests
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()