Skip to content

Commit fb642c9

Browse files
authored
[ci] Move build pipeline to dnceng-public (#1299)
Updates the build pipeline to run in new build in the dnceng-public org: https://dev.azure.com/dnceng-public/public/_build?definitionId=304 The OneLocBuild job has been moved to a separate pipeline file that will run on a schedule in the DevDiv org.
1 parent e288589 commit fb642c9

File tree

2 files changed

+79
-143
lines changed

2 files changed

+79
-143
lines changed

Localize/onelocbuild.yaml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
trigger: none
2+
pr: none
3+
4+
schedules:
5+
- cron: "0 6 * * *"
6+
displayName: Run daily at 6:00 UTC
7+
branches:
8+
include:
9+
- main
10+
- cron: "0 6 * * Sunday"
11+
displayName: Run weekly on Sunday at 6:00 UTC
12+
branches:
13+
include:
14+
- main
15+
always: true
16+
17+
jobs:
18+
- job: OneLocBuild
19+
displayName: OneLocBuild
20+
condition: and(eq(variables['System.TeamProject'], 'DevDiv'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
21+
pool:
22+
name: AzurePipelines-EO
23+
demands:
24+
- ImageOverride -equals 1ESPT-Windows2022
25+
timeoutInMinutes: 30
26+
variables:
27+
- group: Xamarin-Secrets
28+
workspace:
29+
clean: all
30+
steps:
31+
- checkout: self
32+
clean: true
33+
34+
# https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-security-configuration/configuration-guides/pat-burndown-guidance#authentication-from-pipelines
35+
# Requires Azure client 2.x
36+
- task: AzureCLI@2
37+
displayName: 'Set AzDO.OneLocBuildToken'
38+
enabled: true
39+
inputs:
40+
azureSubscription: 'VSEng-AzureDevOps-ceapex-OneLocBuild' # Azure DevOps service connection
41+
scriptType: 'pscore'
42+
scriptLocation: 'inlineScript'
43+
inlineScript: |
44+
# if this fails, check out this bash script that includes diagnostics:
45+
# https://gist.github.com/johnterickson/19f80a3e969e39f1000d118739176e62
46+
# Note that the resource is specified to limit the token to Azure DevOps
47+
$token = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
48+
Write-Host "##vso[task.setvariable variable=AzDO.OneLocBuildToken;issecret=true]${token}"
49+
50+
- task: OneLocBuild@2
51+
displayName: OneLocBuild
52+
env:
53+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
54+
inputs:
55+
locProj: Localize/LocProject.json
56+
outDir: $(Build.StagingDirectory)
57+
packageSourceAuth: patAuth
58+
patVariable: $(AzDO.OneLocBuildToken)
59+
isCreatePrSelected: true
60+
repoType: gitHub
61+
gitHubPatVariable: $(github--pat--vs-mobiletools-engineering-service2)
62+
prSourceBranchPrefix: locpr
63+
isShouldReusePrSelected: true
64+
isAutoCompletePrSelected: false
65+
isUseLfLineEndingsSelected: true
66+
67+
- task: PublishBuildArtifacts@1
68+
displayName: Publish Localization Files
69+
inputs:
70+
PathtoPublish: $(Build.StagingDirectory)/loc
71+
ArtifactName: Loc
72+
condition: succeededOrFailed()

build-tools/automation/azure-pipelines.yaml

+7-143
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,35 @@
33
trigger:
44
- main
55
- release/*
6-
- d17-*
76
- dependabot/*
8-
- dev/*
97

108
pr:
119
branches:
1210
include:
1311
- main
1412
- release/*
15-
- d17-*
1613
paths:
1714
exclude:
1815
- README.md
1916
- Documentation/*
2017

21-
parameters:
22-
- name: ApiScanSourceBranch
23-
default: 'refs/heads/main'
24-
2518
# Global variables
2619
variables:
2720
RunningOnCI: true
2821
Build.Configuration: Release
2922
DotNetCoreVersion: 8.0.303
3023
DotNetTargetFramework: net8.0
3124
NetCoreTargetFrameworkPathSuffix: -$(DotNetTargetFramework)
32-
1ESWindowsPool: AzurePipelines-EO
33-
1ESWindowsImage: AzurePipelinesWindows2022compliant
34-
1ESMacPool: Azure Pipelines
35-
1ESMacImage: macOS-13
36-
DisablePipelineConfigDetector: true
25+
HostedPoolName: Azure Pipelines
26+
HostedWinImage: windows-2022
27+
HostedMacImage: macOS-14
3728

3829
jobs:
3930
- job: windows_dotnet_build
4031
displayName: Windows - .NET
4132
pool:
42-
name: $(1ESWindowsPool)
43-
demands:
44-
- ImageOverride -equals $(1ESWindowsImage)
45-
variables:
46-
VSINSTALLDIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
47-
Codeql.Enabled: true
33+
name: $(HostedPoolName)
34+
vmImage: $(HostedWinImage)
4835
timeoutInMinutes: 60
4936
workspace:
5037
clean: all
@@ -76,8 +63,8 @@ jobs:
7663
- job: mac_dotnet_build
7764
displayName: Mac - .NET
7865
pool:
79-
name: $(1ESMacPool)
80-
vmImage: $(1ESMacImage)
66+
name: $(HostedPoolName)
67+
vmImage: $(HostedMacImage)
8168
timeoutInMinutes: 20
8269
workspace:
8370
clean: all
@@ -98,126 +85,3 @@ jobs:
9885
- template: templates\fail-on-dirty-tree.yaml
9986

10087
- template: templates\fail-on-issue.yaml
101-
102-
103-
- job: api_scan
104-
displayName: API Scan
105-
dependsOn: windows_dotnet_build
106-
condition: and(eq(dependencies.windows_dotnet_build.result, 'Succeeded'), eq(variables['Build.SourceBranch'], '${{ parameters.ApiScanSourceBranch }}'))
107-
pool:
108-
name: MAUI-1ESPT
109-
demands: ImageOverride -equals 1ESPT-Windows2022
110-
timeoutInMinutes: 480
111-
workspace:
112-
clean: all
113-
steps:
114-
- task: DownloadPipelineArtifact@2
115-
displayName: Download build artifacts
116-
inputs:
117-
artifactName: artifacts
118-
downloadPath: $(Build.SourcesDirectory)
119-
120-
### Copy .dll, .exe, .pdb files for APIScan
121-
- task: CopyFiles@2
122-
displayName: Collect Files for APIScan
123-
inputs:
124-
Contents: |
125-
$(Build.SourcesDirectory)\$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)\**\?(*.dll|*.exe|*.pdb)
126-
!$(Build.SourcesDirectory)\**\jnimarshalmethod-gen.*
127-
!$(Build.SourcesDirectory)\**\Mono.CSharp.dll
128-
!$(Build.SourcesDirectory)\**\SgmlReader.exe
129-
!$(Build.SourcesDirectory)\**\win-*\java-interop.dll
130-
TargetFolder: $(Build.StagingDirectory)\apiscan
131-
OverWrite: true
132-
flattenFolders: true
133-
134-
- task: APIScan@2
135-
displayName: Run APIScan
136-
inputs:
137-
softwareFolder: $(Build.StagingDirectory)\apiscan
138-
symbolsFolder: 'SRV*http://symweb;$(Build.StagingDirectory)\apiscan'
139-
softwareName: $(ApiScanName)
140-
softwareVersionNum: $(Build.SourceBranchName)-$(Build.SourceVersion)$(System.JobAttempt)
141-
isLargeApp: true
142-
toolVersion: Latest
143-
env:
144-
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanMAUI1ESPTManagedId)
145-
146-
- task: SdtReport@2
147-
displayName: Guardian Export - Security Report
148-
inputs:
149-
GdnExportAllTools: false
150-
GdnExportGdnToolApiScan: true
151-
GdnExportOutputSuppressionFile: source.gdnsuppress
152-
153-
- task: PublishSecurityAnalysisLogs@3
154-
displayName: Publish Guardian Artifacts
155-
inputs:
156-
ArtifactName: APIScan Logs
157-
ArtifactType: Container
158-
AllTools: false
159-
APIScan: true
160-
ToolLogsNotFoundAction: Warning
161-
162-
- task: PostAnalysis@2
163-
displayName: Fail Build on Guardian Issues
164-
inputs:
165-
GdnBreakAllTools: false
166-
GdnBreakGdnToolApiScan: true
167-
168-
169-
- job: OneLocBuild
170-
displayName: OneLocBuild
171-
condition: and(eq(variables['System.TeamProject'], 'DevDiv'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
172-
pool:
173-
name: AzurePipelines-EO
174-
demands:
175-
- ImageOverride -equals 1ESPT-Windows2022
176-
timeoutInMinutes: 30
177-
variables:
178-
- group: Xamarin-Secrets
179-
workspace:
180-
clean: all
181-
steps:
182-
- checkout: self
183-
clean: true
184-
185-
# https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-security-configuration/configuration-guides/pat-burndown-guidance#authentication-from-pipelines
186-
# Requires Azure client 2.x
187-
- task: AzureCLI@2
188-
displayName: 'Set AzDO.OneLocBuildToken'
189-
enabled: true
190-
inputs:
191-
azureSubscription: 'VSEng-AzureDevOps-ceapex-OneLocBuild' # Azure DevOps service connection
192-
scriptType: 'pscore'
193-
scriptLocation: 'inlineScript'
194-
inlineScript: |
195-
# if this fails, check out this bash script that includes diagnostics:
196-
# https://gist.github.com/johnterickson/19f80a3e969e39f1000d118739176e62
197-
# Note that the resource is specified to limit the token to Azure DevOps
198-
$token = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
199-
Write-Host "##vso[task.setvariable variable=AzDO.OneLocBuildToken;issecret=true]${token}"
200-
201-
- task: OneLocBuild@2
202-
displayName: OneLocBuild
203-
env:
204-
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
205-
inputs:
206-
locProj: Localize/LocProject.json
207-
outDir: $(Build.StagingDirectory)
208-
packageSourceAuth: patAuth
209-
patVariable: $(AzDO.OneLocBuildToken)
210-
isCreatePrSelected: true
211-
repoType: gitHub
212-
gitHubPatVariable: $(github--pat--vs-mobiletools-engineering-service2)
213-
prSourceBranchPrefix: locpr
214-
isShouldReusePrSelected: true
215-
isAutoCompletePrSelected: false
216-
isUseLfLineEndingsSelected: true
217-
218-
- task: PublishBuildArtifacts@1
219-
displayName: Publish Localization Files
220-
inputs:
221-
PathtoPublish: $(Build.StagingDirectory)/loc
222-
ArtifactName: Loc
223-
condition: succeededOrFailed()

0 commit comments

Comments
 (0)