Skip to content

Commit 3847773

Browse files
migrate the pipeline to MicroBuild (#254)
1 parent 2b884fd commit 3847773

File tree

2 files changed

+49
-88
lines changed

2 files changed

+49
-88
lines changed

.azure-pipelines/nightly.yml

Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,28 @@ resources:
1313
- repository: self
1414
type: git
1515
ref: refs/heads/main
16-
- repository: 1esPipelines
16+
- repository: MicroBuildTemplate
1717
type: git
18-
name: 1ESPipelineTemplates/1ESPipelineTemplates
19-
ref: refs/tags/release
18+
name: 1ESPipelineTemplates/MicroBuildTemplate
2019
trigger: none
2120
pr: none
2221
extends:
23-
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
22+
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
2423
parameters:
2524
pool:
26-
name: 1ES_JavaTooling_Pool
27-
image: 1ES_JavaTooling_Windows_2022
28-
os: windows
29-
sdl:
30-
sourceAnalysisPool:
31-
name: 1ES_JavaTooling_Pool
32-
image: 1ES_JavaTooling_Windows_2022
33-
os: windows
34-
customBuildTags:
35-
- MigrationTooling-mseng-VSJava-13437-Tool
25+
name: MSEngSS-MicroBuild2022-1ES
3626
stages:
3727
- stage: Build
3828
jobs:
3929
- job: Job_1
4030
displayName: Agent job 1
4131
templateContext:
32+
mb:
33+
signing:
34+
enabled: true
35+
signType: real
36+
zipSources: false
37+
feedSource: 'https://mseng.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json'
4238
outputs:
4339
- output: pipelineArtifact
4440
artifactName: vsix
@@ -48,6 +44,10 @@ extends:
4844
- checkout: self
4945
clean: true
5046
fetchTags: false
47+
- task: NodeTool@0
48+
displayName: Use Node 20.x
49+
inputs:
50+
versionSpec: 20.x
5151
- task: Npm@1
5252
displayName: 'npm install'
5353
inputs:
@@ -64,13 +64,17 @@ extends:
6464
command: custom
6565
verbose: false
6666
customCommand: 'run compile'
67-
- bash: |
68-
npx json@latest -I -f package.json -e "this.aiKey=\"$(AI_KEY)\""
67+
- task: CmdLine@2
6968
displayName: Replace AI Key
70-
- bash: |
71-
node ./scripts/prepare-nightly-build.js
72-
mv ./package.insiders.json ./package.json
73-
displayName: Generate new package.json
69+
inputs:
70+
script: npx json@latest -I -f package.json -e "this.aiKey=\"%AI_KEY%\""
71+
- task: PowerShell@2
72+
displayName: update version in package json
73+
inputs:
74+
targetType: inline
75+
script: |-
76+
node ./scripts/prepare-nightly-build.js
77+
Move-Item -Path "./package.insiders.json" -Destination "./package.json" -Force
7478
- script: 'npx @vscode/vsce@latest package --pre-release -o extension.vsix'
7579
displayName: 'package vsix'
7680
### Copy files for APIScan
@@ -94,34 +98,12 @@ extends:
9498
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
9599
- script: npx @vscode/vsce@latest generate-manifest -i extension.vsix -o extension.manifest
96100
displayName: 'Generate extension manifest'
97-
- script: cp extension.manifest extension.signature.p7s
101+
- script: copy extension.manifest extension.signature.p7s
98102
displayName: 'Prepare manifest for signing'
99-
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
103+
- task: CmdLine@2
104+
displayName: Sign extension
100105
inputs:
101-
ConnectedServiceName: $(EsrpConnectionServiceName)
102-
AppRegistrationClientId: $(AppRegistrationClientId)
103-
AppRegistrationTenantId: $(AppRegistrationTenantId)
104-
AuthAKVName: $(AuthAKVName)
105-
AuthCertName: $(AuthCertName)
106-
AuthSignCertName: $(AuthSignCertName)
107-
FolderPath: '.'
108-
Pattern: 'extension.signature.p7s'
109-
signConfigType: inlineSignParams
110-
inlineOperation: |
111-
[
112-
{
113-
"keyCode": "CP-401405",
114-
"operationSetCode": "VSCodePublisherSign",
115-
"parameters" : [],
116-
"toolName": "sign",
117-
"toolVersion": "1.0"
118-
}
119-
]
120-
SessionTimeout: 90
121-
MaxConcurrency: 25
122-
MaxRetryAttempts: 5
123-
PendingAnalysisWaitTimeoutMinutes: 5
124-
displayName: 'Sign extension'
106+
script: dotnet %MBSIGN_APPFOLDER%/ddsignfiles.dll /file:extension.signature.p7s /certs:4014052
125107
- task: CopyFiles@2
126108
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
127109
inputs:

.azure-pipelines/rc.yml

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,28 @@ resources:
77
- repository: self
88
type: git
99
ref: refs/heads/main
10-
- repository: 1esPipelines
10+
- repository: MicroBuildTemplate
1111
type: git
12-
name: 1ESPipelineTemplates/1ESPipelineTemplates
13-
ref: refs/tags/release
12+
name: 1ESPipelineTemplates/MicroBuildTemplate
1413
trigger: none
1514
pr: none
1615
extends:
17-
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
16+
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
1817
parameters:
1918
pool:
20-
name: 1ES_JavaTooling_Pool
21-
image: 1ES_JavaTooling_Windows_2022
22-
os: windows
23-
sdl:
24-
sourceAnalysisPool:
25-
name: 1ES_JavaTooling_Pool
26-
image: 1ES_JavaTooling_Windows_2022
27-
os: windows
28-
customBuildTags:
29-
- MigrationTooling-mseng-VSJava-13437-Tool
19+
name: MSEngSS-MicroBuild2022-1ES
3020
stages:
3121
- stage: Build
3222
jobs:
3323
- job: Job_1
3424
displayName: Agent job 1
3525
templateContext:
26+
mb:
27+
signing:
28+
enabled: true
29+
signType: real
30+
zipSources: false
31+
feedSource: 'https://mseng.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json'
3632
outputs:
3733
- output: pipelineArtifact
3834
artifactName: vsix
@@ -42,6 +38,10 @@ extends:
4238
- checkout: self
4339
clean: true
4440
fetchTags: false
41+
- task: NodeTool@0
42+
displayName: Use Node 20.x
43+
inputs:
44+
versionSpec: 20.x
4545
- task: Npm@1
4646
displayName: 'npm install'
4747
inputs:
@@ -58,9 +58,10 @@ extends:
5858
command: custom
5959
verbose: false
6060
customCommand: 'run compile'
61-
- bash: |
62-
npx json@latest -I -f package.json -e "this.aiKey=\"$(AI_KEY)\""
61+
- task: CmdLine@2
6362
displayName: Replace AI Key
63+
inputs:
64+
script: npx json@latest -I -f package.json -e "this.aiKey=\"%AI_KEY%\""
6465
- script: 'npx @vscode/vsce@latest package -o extension.vsix'
6566
displayName: 'package vsix'
6667
### Copy files for APIScan
@@ -84,34 +85,12 @@ extends:
8485
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
8586
- script: npx @vscode/vsce@latest generate-manifest -i extension.vsix -o extension.manifest
8687
displayName: 'Generate extension manifest'
87-
- script: cp extension.manifest extension.signature.p7s
88+
- script: copy extension.manifest extension.signature.p7s
8889
displayName: 'Prepare manifest for signing'
89-
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
90+
- task: CmdLine@2
91+
displayName: Sign extension
9092
inputs:
91-
ConnectedServiceName: $(EsrpConnectionServiceName)
92-
AppRegistrationClientId: $(AppRegistrationClientId)
93-
AppRegistrationTenantId: $(AppRegistrationTenantId)
94-
AuthAKVName: $(AuthAKVName)
95-
AuthCertName: $(AuthCertName)
96-
AuthSignCertName: $(AuthSignCertName)
97-
FolderPath: '.'
98-
Pattern: 'extension.signature.p7s'
99-
signConfigType: inlineSignParams
100-
inlineOperation: |
101-
[
102-
{
103-
"keyCode": "CP-401405",
104-
"operationSetCode": "VSCodePublisherSign",
105-
"parameters" : [],
106-
"toolName": "sign",
107-
"toolVersion": "1.0"
108-
}
109-
]
110-
SessionTimeout: 90
111-
MaxConcurrency: 25
112-
MaxRetryAttempts: 5
113-
PendingAnalysisWaitTimeoutMinutes: 5
114-
displayName: 'Sign extension'
93+
script: dotnet %MBSIGN_APPFOLDER%/ddsignfiles.dll /file:extension.signature.p7s /certs:4014052
11594
- task: CopyFiles@2
11695
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
11796
inputs:

0 commit comments

Comments
 (0)