@@ -12,31 +12,28 @@ resources:
12
12
- repository : self
13
13
type : git
14
14
ref : refs/heads/main
15
- - repository : 1esPipelines
15
+ - repository : MicroBuildTemplate
16
16
type : git
17
- name : 1ESPipelineTemplates/1ESPipelineTemplates
18
- ref : refs/tags/release
17
+ name : 1ESPipelineTemplates/MicroBuildTemplate
19
18
trigger : none
20
19
extends :
21
- template : v1/ 1ES.Official.PipelineTemplate. yml@1esPipelines
20
+ template : azure-pipelines/MicroBuild. 1ES.Official.yml@MicroBuildTemplate
22
21
parameters :
23
22
pool :
24
- name : 1ES_JavaTooling_Pool
25
- image : 1ES_JavaTooling_Windows_2022
23
+ name : MSEngSS-MicroBuild2022-1ES
26
24
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
34
25
stages :
35
26
- stage : Build
36
27
jobs :
37
28
- job : Job_1
38
29
displayName : VSCode-Test-Runner-Nightly
39
30
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'
40
37
outputs :
41
38
- output : pipelineArtifact
42
39
artifactName : extension
@@ -45,12 +42,28 @@ extends:
45
42
steps :
46
43
- checkout : self
47
44
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"
48
57
- task : JavaToolInstaller@0
49
58
displayName : Use Java 17
50
59
inputs :
51
60
versionSpec : " 17"
52
61
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'
54
67
- task : Npm@1
55
68
displayName : npm install
56
69
inputs :
@@ -67,49 +80,28 @@ extends:
67
80
command : custom
68
81
verbose : false
69
82
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
72
85
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'
102
94
- task : CmdLine@2
103
95
displayName : Replace AI Key
104
96
inputs :
105
97
script : npx json@9.0.6 -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
108
100
inputs :
109
101
targetType : inline
110
102
script : |-
111
103
node ./scripts/prepare-nightly-build.js
112
- mv ./package.insiders.json ./package.json
104
+ Move-Item -Path " ./package.insiders.json" -Destination " ./package.json" -Force
113
105
- task : CmdLine@2
114
106
displayName : vsce package --pre-release
115
107
inputs :
@@ -135,34 +127,12 @@ extends:
135
127
AzureServicesAuthConnectionString : runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
136
128
- script : npx @vscode/vsce@latest generate-manifest -i extension.vsix -o extension.manifest
137
129
displayName : ' Generate extension manifest'
138
- - script : cp extension.manifest extension.signature.p7s
130
+ - script : copy extension.manifest extension.signature.p7s
139
131
displayName : ' Prepare manifest for signing'
140
- - task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
132
+ - task : CmdLine@2
133
+ displayName : Sign extension
141
134
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
166
136
- task : CopyFiles@2
167
137
displayName : " Copy Files to: $(Build.ArtifactStagingDirectory)"
168
138
inputs :
0 commit comments