This repository has been archived by the owner on May 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
azure-pipelines.yml
101 lines (84 loc) · 3.63 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
trigger:
- master
- rel/*
pr:
- master
- rel/*
pool:
vmImage: vs2017-win2016
variables:
BuildConfiguration: Release
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
steps:
- task: DotNetCoreInstaller@0
inputs:
version: '2.2.102'
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool
- script: nbgv cloud
displayName: Set Version
- powershell: |
# version
$ver = .\nbgv get-version -f json | ConvertFrom-Json
$doc = Get-Content ".\templates\xunit.devices.templates\source.extension.vsixmanifest"
$doc | % { $_.Replace("0.9.9", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple)") } | Set-Content ".\templates\xunit.devices.templates\source.extension.vsixmanifest"
$doc = Get-Content ".\templates\xunit.devices.templates\source.extension.vsixmanifest"
$doc | % { $_.Replace("9.9.9", "$($ver.NuGetPackageVersion)") } | Set-Content ".\templates\xunit.devices.templates\source.extension.vsixmanifest"
# ProjectTemplates
# Android
$doc = Get-Content ".\templates\xunit.android.template\xunit.android.template.vstemplate"
$doc | % { $_.Replace("0.9.9", "$($ver.NuGetPackageVersion)") } | Set-Content ".\templates\xunit.android.template\xunit.android.template.vstemplate"
# iOS
$doc = Get-Content ".\templates\xunit.ios.template\xunit.ios.template.vstemplate"
$doc | % { $_.Replace("0.9.9", "$($ver.NuGetPackageVersion)") } | Set-Content ".\templates\xunit.ios.template\xunit.ios.template.vstemplate"
# UWP
$doc = Get-Content ".\templates\xunit.uwp.template\xunit.uwp.template.vstemplate"
$doc | % { $_.Replace("0.9.9", "$($ver.NuGetPackageVersion)") } | Set-Content ".\templates\xunit.uwp.template\xunit.uwp.template.vstemplate"
displayName: Update Versions
- powershell: mkdir $(Build.ArtifactStagingDirectory)\CI
displayName: Create output directory
- task: MSBuild@1
displayName: Build
inputs:
solution: xUnit.Devices.sln
msbuildArguments: /restore /p:UseDotNetNativeToolchain=false /p:BuildAppxUploadPackageForUap=true /p:DeployExtension=false
configuration: $(BuildConfiguration)
maximumCpuCount: true
- task: MSBuild@1
displayName: Pack devices
inputs:
solution: src\xunit.runner.devices\xunit.runner.devices.csproj
msbuildArguments: /t:pack /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\CI
configuration: $(BuildConfiguration)
maximumCpuCount: true
- powershell: |
mkdir $(Build.ArtifactStagingDirectory)\Vsix
mv templates\xunit.devices.templates\bin\Release\*.vsix $(Build.ArtifactStagingDirectory)\Vsix
copy templates\xunit.devices.templates\extension.manifest.json $(Build.ArtifactStagingDirectory)\Vsix
copy templates\xunit.devices.templates\readme.md $(Build.ArtifactStagingDirectory)\Vsix
displayName: Move VISX to output directory
- task: PowerShell@2
displayName: Authenticode Artifacts
inputs:
filePath: scripts/Sign-Package.ps1
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
ArtifactDirectory: $(Build.ArtifactStagingDirectory)
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
- task: PublishBuildArtifacts@1
displayName: Publish CI Artifacts
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)\CI
artifactType: container
artifactName: CI
- task: PublishBuildArtifacts@1
displayName: Publish Vsix Artifacts
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)\Vsix
artifactType: container
artifactName: Vsix