forked from microsoft/MSBuildSdks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-official.yml
82 lines (82 loc) · 2.55 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:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
variables:
ArtifactsDirectoryName: 'artifacts'
BuildConfiguration: 'Release'
BuildPlatform: 'Any CPU'
DotNetVersion: '8.x'
MSBuildArgs: '"/p:Platform=$(BuildPlatform)" "/p:Configuration=$(BuildConfiguration)" "/BinaryLogger:$(Build.SourcesDirectory)\$(ArtifactsDirectoryName)\msbuild.binlog"'
SignType: 'Real'
trigger:
batch: 'true'
branches:
include:
- 'main'
- 'rel/*'
- 'refs/tags/*'
paths:
exclude:
- '*.md'
pr: none
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
sdl:
sbom:
enabled: false
pool:
name: VSEngSS-MicroBuild2022-1ES
demands:
- msbuild
- visualstudio
os: windows
stages:
- stage: ''
displayName: 'Build'
jobs:
- job: Build
displayName: 'Build'
pool:
name: 'VSEngSS-MicroBuild2022-1ES'
templateContext:
mb:
signing:
enabled: true
signType: 'real'
zipSources: false
outputs:
- output: pipelineArtifact
displayName: 'Publish Artifacts'
condition: always()
targetPath: '$(ArtifactsDirectoryName)'
artifactName: $(ArtifactsDirectoryName)
steps:
- task: PowerShell@2
displayName: 'Update Build Number, and Add Build Tag for tagged commits'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/Microsoft.Build'))
inputs:
targetType: 'inline'
script: |
$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: VSBuild@1
displayName: 'Build Solution'
inputs:
projects: 'MSBuildSdks.sln'
msbuildArgs: '$(MSBuildArgs)'
msbuildArchitecture: 'x64'