forked from microsoft/slngen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-official.yml
109 lines (97 loc) · 2.92 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
resources:
- repo: self
variables:
ArtifactsDirectoryName: 'artifacts'
BuildConfiguration: 'Release'
BuildPlatform: 'Any CPU'
DotNetCore3Version: '3.x'
DotNet5Version: '5.x'
DotNet6Version: '6.x'
MSBuildArgs: '"/p:Platform=$(BuildPlatform)" "/p:Configuration=$(BuildConfiguration)" "/BinaryLogger:$(Build.SourcesDirectory)\$(ArtifactsDirectoryName)\msbuild.binlog"'
SignType: 'Test'
trigger:
batch: true
branches:
include:
- 'main'
- '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:
- script: 'echo ##vso[task.setvariable variable=SignType;]Real'
displayName: 'Set SignType to Real for tagged commits'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
- task: UseDotNet@2
displayName: 'Install .NET Core $(DotNetCore3Version)'
inputs:
version: '$(DotNetCore3Version)'
- task: UseDotNet@2
displayName: 'Install .NET $(DotNet5Version)'
inputs:
version: '$(DotNet5Version)'
- task: UseDotNet@2
displayName: 'Install .NET $(DotNet6Version)'
inputs:
version: '$(DotNet6Version)'
- task: MicroBuildSigningPlugin@1
displayName: 'Install MicroBuild Signing Plugin'
inputs:
signType: '$(SignType)'
zipSources: false
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: '**\*.sln'
msbuildArgs: '$(MSBuildArgs)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: '$(ArtifactsDirectoryName)'
ArtifactName: $(ArtifactsDirectoryName)
condition: always()
- stage:
displayName: 'Deploy'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
jobs:
- deployment: 'NuGet'
displayName: 'Publish NuGet Packages'
pool:
vmImage: 'windows-latest'
environment: 'SlnGen-NuGet'
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
displayName: 'Push NuGet Packages to nuget.org'
inputs:
command: 'push'
packagesToPush: '$(Pipeline.Workspace)/$(ArtifactsDirectoryName)/**/Microsoft.VisualStudio.SlnGen*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'NuGet-1ES-Full'
condition: always()
- task: NuGetCommand@2
displayName: 'Push SlnGen.Corext'
inputs:
command: 'push'
packagesToPush: '$(Pipeline.Workspace)/$(ArtifactsDirectoryName)/**/SlnGen.Corext*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'CloudBuild-Push'
condition: always()