@@ -12,31 +12,28 @@ resources:
1212 - repository : self
1313 type : git
1414 ref : refs/heads/main
15- - repository : 1esPipelines
15+ - repository : MicroBuildTemplate
1616 type : git
17- name : 1ESPipelineTemplates/1ESPipelineTemplates
18- ref : refs/tags/release
17+ name : 1ESPipelineTemplates/MicroBuildTemplate
1918trigger : none
2019extends :
21- template : v1/ 1ES.Official.PipelineTemplate. yml@1esPipelines
20+ template : azure-pipelines/MicroBuild. 1ES.Official.yml@MicroBuildTemplate
2221 parameters :
2322 pool :
24- name : 1ES_JavaTooling_Pool
25- image : 1ES_JavaTooling_Windows_2022
23+ name : MSEngSS-MicroBuild2022-1ES
2624 os : windows
27- sdl :
28- sourceAnalysisPool :
29- name : 1ES_JavaTooling_Pool
30- image : 1ES_JavaTooling_Windows_2022
31- os : windows
32- customBuildTags :
33- - MigrationTooling-mseng-VSJava-13462-Tool
3425 stages :
3526 - stage : Build
3627 jobs :
3728 - job : Job_1
3829 displayName : VSCode-Test-Runner-Nightly
3930 templateContext :
31+ mb :
32+ signing :
33+ enabled : true
34+ signType : real
35+ zipSources : false
36+ feedSource : ' https://mseng.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json'
4037 outputs :
4138 - output : pipelineArtifact
4239 artifactName : extension
@@ -45,12 +42,28 @@ extends:
4542 steps :
4643 - checkout : self
4744 fetchTags : true
45+ - task : UseNode@1
46+ displayName : Use Node 20.x
47+ inputs :
48+ version : ' 20.x'
49+ # The image does not have jdk preinstalled, we need to download it first.
50+ - task : PowerShell@2
51+ displayName : Download JDK 17
52+ inputs :
53+ targetType : ' inline'
54+ script : |-
55+ New-Item -ItemType Directory -Path "$env:AGENT_TEMPDIRECTORY\downloadjdk"
56+ Invoke-WebRequest -Uri "https://aka.ms/download-jdk/microsoft-jdk-17-windows-x64.zip" -OutFile "$env:AGENT_TEMPDIRECTORY\downloadjdk\microsoft-jdk-17-windows-x64.zip"
4857 - task : JavaToolInstaller@0
4958 displayName : Use Java 17
5059 inputs :
5160 versionSpec : " 17"
5261 jdkArchitectureOption : x64
53- jdkSourceOption : PreInstalled
62+ jdkSourceOption : LocalDirectory
63+ jdkFile : $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-17-windows-x64.zip
64+ jdkDestinationDirectory : $(Agent.ToolsDirectory)/ms-jdk17
65+ - script : java --version
66+ displayName : ' Check Java installation'
5467 - task : Npm@1
5568 displayName : npm install
5669 inputs :
@@ -67,49 +80,28 @@ extends:
6780 command : custom
6881 verbose : false
6982 customCommand : run build-plugin
70- - task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
71- displayName : ESRP CodeSigning
83+ - task : PowerShell@2
84+ displayName : Sign Jars
7285 inputs :
73- ConnectedServiceName : $(EsrpConnectionServiceName)
74- AppRegistrationClientId : $(AppRegistrationClientId)
75- AppRegistrationTenantId : $(AppRegistrationTenantId)
76- AuthAKVName : $(AuthAKVName)
77- AuthCertName : $(AuthCertName)
78- AuthSignCertName : $(AuthSignCertName)
79- FolderPath : server
80- Pattern : com.microsoft.java.test.*.jar
81- signConfigType : inlineSignParams
82- inlineOperation : |-
83- [
84- {
85- "KeyCode" : "CP-447347-Java",
86- "OperationCode" : "JavaSign",
87- "Parameters" : {
88- "SigAlg" : "SHA256withRSA",
89- "Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp"
90- },
91- "ToolName" : "sign",
92- "ToolVersion" : "1.0"
93- },
94- {
95- "KeyCode" : "CP-447347-Java",
96- "OperationCode" : "JavaVerify",
97- "Parameters" : {},
98- "ToolName" : "sign",
99- "ToolVersion" : "1.0"
100- }
101- ]
86+ targetType : ' inline'
87+ script : |-
88+ $files = Get-ChildItem -Path . -Recurse -Filter "com.microsoft.java.test.*.jar"
89+ foreach ($file in $files) {
90+ $fileName = $file.Name
91+ & dotnet "$env:MBSIGN_APPFOLDER\DDSignFiles.dll" /file:"$fileName" /certs:100010171
92+ }
93+ workingDirectory : ' server'
10294 - task : CmdLine@2
10395 displayName : Replace AI Key
10496 inputs :
10597 script :
npx [email protected] -I -f package.json -e "this.aiKey=\"%AI_KEY%\"" 106- - task : Bash@3
107- displayName : Bash Script
98+ - task : PowerShell@2
99+ displayName : Update package.json
108100 inputs :
109101 targetType : inline
110102 script : |-
111103 node ./scripts/prepare-nightly-build.js
112- mv ./package.insiders.json ./package.json
104+ Move-Item -Path " ./package.insiders.json" -Destination " ./package.json" -Force
113105 - task : CmdLine@2
114106 displayName : vsce package --pre-release
115107 inputs :
@@ -135,34 +127,12 @@ extends:
135127 AzureServicesAuthConnectionString : runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
136128 - script : npx @vscode/vsce@latest generate-manifest -i extension.vsix -o extension.manifest
137129 displayName : ' Generate extension manifest'
138- - script : cp extension.manifest extension.signature.p7s
130+ - script : copy extension.manifest extension.signature.p7s
139131 displayName : ' Prepare manifest for signing'
140- - task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
132+ - task : CmdLine@2
133+ displayName : Sign extension
141134 inputs :
142- ConnectedServiceName : $(EsrpConnectionServiceName)
143- AppRegistrationClientId : $(AppRegistrationClientId)
144- AppRegistrationTenantId : $(AppRegistrationTenantId)
145- AuthAKVName : $(AuthAKVName)
146- AuthCertName : $(AuthCertName)
147- AuthSignCertName : $(AuthSignCertName)
148- FolderPath : ' .'
149- Pattern : ' extension.signature.p7s'
150- signConfigType : inlineSignParams
151- inlineOperation : |
152- [
153- {
154- "keyCode": "CP-401405",
155- "operationSetCode": "VSCodePublisherSign",
156- "parameters" : [],
157- "toolName": "sign",
158- "toolVersion": "1.0"
159- }
160- ]
161- SessionTimeout : 90
162- MaxConcurrency : 25
163- MaxRetryAttempts : 5
164- PendingAnalysisWaitTimeoutMinutes : 5
165- displayName : ' Sign extension'
135+ script : dotnet %MBSIGN_APPFOLDER%/ddsignfiles.dll /file:extension.signature.p7s /certs:4014052
166136 - task : CopyFiles@2
167137 displayName : " Copy Files to: $(Build.ArtifactStagingDirectory)"
168138 inputs :
0 commit comments