Skip to content

Commit d158387

Browse files
Create a separate unofficial.yml pipeline (#334)
1 parent 862f998 commit d158387

5 files changed

Lines changed: 141 additions & 89 deletions

File tree

Expand-Template.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ try {
156156
$YmlReplacements = @{
157157
"(?m)^\s+- microbuild`r?`n"=""
158158
}
159-
Replace-Placeholders -Path "azure-pipelines\official.yml" -Replacements $YmlReplacements
159+
Replace-Placeholders -Path "azure-pipelines\unofficial.yml" -Replacements $YmlReplacements
160160
Replace-Placeholders -Path "azure-pipelines.yml" -Replacements $YmlReplacements
161161

162162
$YmlReplacements = @{}

azure-pipelines/apiscan.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
parameters:
22
- name: windowsPool
33
type: object
4+
- name: RealSign
5+
type: boolean
46

57
jobs:
68
- job: apiscan
@@ -9,6 +11,12 @@ jobs:
911
pool: ${{ parameters.windowsPool }}
1012
timeoutInMinutes: 120
1113
templateContext:
14+
${{ if not(parameters.RealSign) }}:
15+
mb:
16+
signing: # if the build is test-signed, install the signing plugin so that CSVTestSignPolicy.xml is available
17+
enabled: true
18+
zipSources: false
19+
signType: test
1220
outputs:
1321
- output: pipelineArtifact
1422
displayName: 📢 collect apiscan artifact

azure-pipelines/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,4 @@ jobs:
313313
- template: apiscan.yml
314314
parameters:
315315
windowsPool: ${{ parameters.windowsPool }}
316+
RealSign: ${{ parameters.RealSign }}

azure-pipelines/official.yml

Lines changed: 41 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
trigger:
2-
batch: true
3-
branches:
4-
include:
5-
- main
6-
- microbuild
7-
- 'validate/*'
8-
paths:
9-
exclude:
10-
- doc/
11-
- '*.md'
12-
- .vscode/
13-
- azure-pipelines/release.yml
14-
- azure-pipelines/vs-insertion.yml
1+
trigger: none # We only want to trigger manually or based on a schedule
2+
pr: none
153
#schedules:
164
#- cron: "0 3 * * *" # Daily @ 8 PM PST
175
# displayName: Daily vs-insertion
@@ -23,10 +11,6 @@ parameters:
2311
# As an entrypoint pipeline yml file, all parameters here show up in the Queue Run dialog.
2412
# If any paramaters should NOT be queue-time options, they should be removed from here
2513
# and references to them in this file replaced with hard-coded values.
26-
- name: ForceOfficialBuild
27-
displayName: Official build (sign, compliance, etc.)
28-
type: boolean
29-
default: false # this should remain false so PR builds using this pipeline are unofficial
3014
# - name: ShouldSkipOptimize # Uncomment this and references to it below when setting EnableOptProf to true in build.yml.
3115
# displayName: Skip OptProf optimization
3216
# type: boolean
@@ -55,75 +39,44 @@ variables:
5539
- template: GlobalVariables.yml
5640

5741
extends:
58-
${{ if or(parameters.ForceOfficialBuild, eq(variables['Build.Reason'],'Schedule')) }}:
59-
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
60-
parameters:
61-
sdl:
62-
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
63-
codeSignValidation:
64-
enabled: true
65-
break: true
66-
additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\**
67-
policheck:
68-
enabled: true
69-
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
70-
suppression:
71-
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
72-
sbom:
73-
enabled: true
74-
stages:
75-
- stage: Build
76-
variables:
77-
- template: /azure-pipelines/BuildStageVariables.yml@self
78-
jobs:
79-
- template: /azure-pipelines/build.yml@self
80-
parameters:
81-
Is1ESPT: true
82-
RealSign: true
83-
# ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
84-
EnableAPIScan: ${{ and(parameters.EnableAPIScan, ne(variables['Build.Reason'], 'pullRequest')) }}
85-
windowsPool: VSEngSS-MicroBuild2022-1ES
86-
linuxPool:
87-
name: AzurePipelines-EO
88-
demands:
89-
- ImageOverride -equals 1ESPT-Ubuntu22.04
90-
os: Linux
91-
macOSPool:
92-
name: Azure Pipelines
93-
vmImage: macOS-14
94-
os: macOS
95-
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
96-
RunTests: ${{ parameters.RunTests }}
97-
- template: /azure-pipelines/prepare-insertion-stages.yml@self
42+
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
43+
parameters:
44+
sdl:
45+
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
46+
codeSignValidation:
47+
enabled: true
48+
break: true
49+
additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\**
50+
policheck:
51+
enabled: true
52+
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
53+
suppression:
54+
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
55+
sbom:
56+
enabled: true
57+
stages:
58+
- stage: Build
59+
variables:
60+
- template: /azure-pipelines/BuildStageVariables.yml@self
61+
jobs:
62+
- template: /azure-pipelines/build.yml@self
9863
parameters:
64+
Is1ESPT: true
9965
RealSign: true
100-
${{ else }}:
101-
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
102-
parameters:
103-
sdl:
104-
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
105-
suppression:
106-
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
107-
stages:
108-
- stage: Build
109-
variables:
110-
- template: /azure-pipelines/BuildStageVariables.yml@self
111-
jobs:
112-
- template: /azure-pipelines/build.yml@self
113-
parameters:
114-
Is1ESPT: true
115-
RealSign: false
116-
# ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
117-
EnableAPIScan: false
118-
windowsPool: VSEngSS-MicroBuild2022-1ES
119-
linuxPool:
120-
name: AzurePipelines-EO
121-
demands:
122-
- ImageOverride -equals 1ESPT-Ubuntu22.04
123-
os: Linux
124-
macOSPool:
125-
name: Azure Pipelines
126-
vmImage: macOS-14
127-
os: macOS
128-
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
129-
RunTests: ${{ parameters.RunTests }}
66+
# ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
67+
EnableAPIScan: ${{ parameters.EnableAPIScan }}
68+
windowsPool: VSEngSS-MicroBuild2022-1ES
69+
linuxPool:
70+
name: AzurePipelines-EO
71+
demands:
72+
- ImageOverride -equals 1ESPT-Ubuntu22.04
73+
os: Linux
74+
macOSPool:
75+
name: Azure Pipelines
76+
vmImage: macOS-14
77+
os: macOS
78+
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
79+
RunTests: ${{ parameters.RunTests }}
80+
- template: /azure-pipelines/prepare-insertion-stages.yml@self
81+
parameters:
82+
RealSign: true

azure-pipelines/unofficial.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
trigger:
2+
batch: true
3+
branches:
4+
include:
5+
- main
6+
- microbuild
7+
- 'validate/*'
8+
paths:
9+
exclude:
10+
- doc/
11+
- '*.md'
12+
- .vscode/
13+
- azure-pipelines/release.yml
14+
- azure-pipelines/vs-insertion.yml
15+
16+
parameters:
17+
# As an entrypoint pipeline yml file, all parameters here show up in the Queue Run dialog.
18+
# If any paramaters should NOT be queue-time options, they should be removed from here
19+
# and references to them in this file replaced with hard-coded values.
20+
# - name: ShouldSkipOptimize # Uncomment this and references to it below when setting EnableOptProf to true in build.yml.
21+
# displayName: Skip OptProf optimization
22+
# type: boolean
23+
# default: false
24+
- name: EnableMacOSBuild
25+
displayName: Build on macOS
26+
type: boolean
27+
default: false # macOS is often bogged down in Azure Pipelines
28+
- name: RunTests
29+
displayName: Run tests
30+
type: boolean
31+
default: true
32+
- name: EnableAPIScan
33+
displayName: Include APIScan with compliance tools
34+
type: boolean
35+
default: false
36+
- name: EnableProductionSDL
37+
displayName: Enable Production SDL
38+
type: boolean
39+
default: false
40+
41+
resources:
42+
repositories:
43+
- repository: MicroBuildTemplate
44+
type: git
45+
name: 1ESPipelineTemplates/MicroBuildTemplate
46+
ref: refs/tags/release
47+
48+
variables:
49+
- template: GlobalVariables.yml
50+
51+
extends:
52+
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
53+
parameters:
54+
sdl:
55+
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
56+
suppression:
57+
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
58+
enableProductionSDL: ${{ parameters.EnableProductionSDL }}
59+
codeSignValidation:
60+
enabled: ${{ parameters.EnableProductionSDL }}
61+
break: true
62+
policyFile: $(MBSIGN_APPFOLDER)\CSVTestSignPolicy.xml
63+
policheck:
64+
enabled: ${{ parameters.EnableProductionSDL }}
65+
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
66+
sbom:
67+
enabled: ${{ parameters.EnableProductionSDL }}
68+
stages:
69+
- stage: Build
70+
variables:
71+
- template: /azure-pipelines/BuildStageVariables.yml@self
72+
jobs:
73+
- template: /azure-pipelines/build.yml@self
74+
parameters:
75+
Is1ESPT: true
76+
RealSign: false
77+
# ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
78+
EnableAPIScan: ${{ parameters.EnableAPIScan }}
79+
windowsPool: VSEngSS-MicroBuild2022-1ES
80+
linuxPool:
81+
name: AzurePipelines-EO
82+
demands:
83+
- ImageOverride -equals 1ESPT-Ubuntu22.04
84+
os: Linux
85+
macOSPool:
86+
name: Azure Pipelines
87+
vmImage: macOS-14
88+
os: macOS
89+
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
90+
RunTests: ${{ parameters.RunTests }}

0 commit comments

Comments
 (0)