forked from microsoft/MSBuildSdks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-official.yml
82 lines (74 loc) · 2.23 KB
/
azure-pipelines-official.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
resources:
- repo: self
variables:
ArtifactsDirectoryName: 'artifacts'
BuildConfiguration: 'Release'
BuildPlatform: 'Any CPU'
DotNetVersion: '6.x'
MSBuildArgs: '"/p:Platform=$(BuildPlatform)" "/p:Configuration=$(BuildConfiguration)" "/BinaryLogger:$(Build.SourcesDirectory)\$(ArtifactsDirectoryName)\msbuild.binlog"'
SignType: 'Test'
trigger:
batch: 'true'
branches:
include:
- 'main'
- 'rel/*'
- 'refs/tags/*'
paths:
exclude:
- '*.md'
pr:
branches:
include:
- 'main'
- 'rel/*'
paths:
exclude:
- '*.md'
stages:
- stage:
displayName: 'Build'
jobs:
- job: Build
displayName: 'Build'
pool:
name: 'VSEngSS-MicroBuild2022-1ES'
steps:
- task: PowerShell@2
displayName: 'Update SignType, Build Number, and Add Build Tag for tagged commits'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/Microsoft.Build'))
inputs:
targetType: 'inline'
script: |
Write-Host "Updating SignType to 'Real'"
Write-Host "##vso[task.setvariable variable=SignType;]Real"
Write-Host ""
$buildTag = [System.Text.RegularExpressions.Regex]::Match("$(Build.SourceBranchName)", "Microsoft\.Build\.[\w\.]+.*")
if($buildTag.Success -eq $true)
{
Write-Host "Updating VSTS build number to ""$buildTag"""
Write-Host "##vso[build.updatebuildnumber]$buildTag"
Write-Host ""
Write-Host "Adding build tag ""$buildTag"""
Write-Host "##vso[build.addbuildtag]$buildTag"
}
- task: UseDotNet@2
displayName: 'Install .NET $(DotNetVersion)'
inputs:
version: '$(DotNetVersion)'
- task: MicroBuildSigningPlugin@4
displayName: 'Install MicroBuild Signing Plugin'
inputs:
signType: '$(SignType)'
zipSources: false
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
projects: 'MSBuildSdks.sln'
msbuildArgs: '$(MSBuildArgs)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: '$(ArtifactsDirectoryName)'
ArtifactName: $(ArtifactsDirectoryName)
condition: always()