devices.xunit/azure-pipelines.yml

86 строки
3.2 KiB
YAML

trigger:
- master
- rel/*
pool:
vmImage: vs2017-win2016
variables:
BuildConfiguration: Release
steps:
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool
- script: nbgv cloud
displayName: Set Version
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
- 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: mv templates\xunit.devices.templates\bin\Release\*.vsix $(Build.ArtifactStagingDirectory)\CI
displayName: Move VISX to output directory
- task: PowerShell@2
displayName: Authenticode Sign Nightly artifacts
inputs:
filePath: scripts/Sign-Package.ps1
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
ArtifactDirectory: $(Build.ArtifactStagingDirectory)\CI
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
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))