Skip to content

Commit 666ac40

Browse files
authored
build: Migrate to 1ES pipeline (#814)
Signed-off-by: sheche <sheche@microsoft.com>
1 parent dbe5c65 commit 666ac40

File tree

4 files changed

+303
-0
lines changed

4 files changed

+303
-0
lines changed

.azure-pipelines/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: $(Date:yyyyMMdd).$(Rev:r)
2+
variables:
3+
- name: Codeql.Enabled
4+
value: true
5+
resources:
6+
repositories:
7+
- repository: self
8+
type: git
9+
ref: refs/heads/main
10+
- repository: 1esPipelines
11+
type: git
12+
name: 1ESPipelineTemplates/1ESPipelineTemplates
13+
ref: refs/tags/release
14+
trigger:
15+
branches:
16+
include:
17+
- main
18+
extends:
19+
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
20+
parameters:
21+
pool:
22+
os: linux
23+
name: 1ES_JavaTooling_Pool
24+
image: 1ES_JavaTooling_Ubuntu-2004
25+
sdl:
26+
sourceAnalysisPool:
27+
name: 1ES_JavaTooling_Pool
28+
image: 1ES_JavaTooling_Windows_2022
29+
os: windows
30+
customBuildTags:
31+
- MigrationTooling-mseng-VSJava-9020-Tool
32+
stages:
33+
- stage: Build
34+
jobs:
35+
- job: Job_1
36+
displayName: CI
37+
templateContext:
38+
outputs:
39+
- output: pipelineArtifact
40+
artifactName: extension
41+
targetPath: $(Build.ArtifactStagingDirectory)
42+
displayName: "Publish Artifact: extension"
43+
steps:
44+
- checkout: self
45+
fetchTags: false
46+
- task: JavaToolInstaller@0
47+
displayName: Use Java 17
48+
inputs:
49+
versionSpec: "17"
50+
jdkArchitectureOption: x64
51+
jdkSourceOption: PreInstalled
52+
- task: NodeTool@0
53+
displayName: Use Node 16.x
54+
inputs:
55+
versionSpec: 16.x
56+
- task: Npm@1
57+
displayName: npm install
58+
inputs:
59+
verbose: true
60+
- task: Npm@1
61+
displayName: npm run build-server
62+
inputs:
63+
command: custom
64+
verbose: false
65+
customCommand: run build-server
66+
- task: Bash@3
67+
displayName: vsce package
68+
inputs:
69+
targetType: inline
70+
script: |-
71+
cd $(Build.SourcesDirectory)
72+
73+
npx @vscode/vsce@latest package
74+
- task: CopyFiles@2
75+
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
76+
inputs:
77+
Contents: "*.vsix"
78+
TargetFolder: $(Build.ArtifactStagingDirectory)

.azure-pipelines/nightly.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: $(Date:yyyyMMdd).$(Rev:r)
2+
variables:
3+
- name: Codeql.Enabled
4+
value: true
5+
schedules:
6+
- cron: 0 0 * * *
7+
branches:
8+
include:
9+
- refs/heads/main
10+
resources:
11+
repositories:
12+
- repository: self
13+
type: git
14+
ref: refs/heads/main
15+
- repository: 1esPipelines
16+
type: git
17+
name: 1ESPipelineTemplates/1ESPipelineTemplates
18+
ref: refs/tags/release
19+
trigger: none
20+
extends:
21+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
22+
parameters:
23+
pool:
24+
os: linux
25+
name: 1ES_JavaTooling_Pool
26+
image: 1ES_JavaTooling_Ubuntu-2004
27+
sdl:
28+
sourceAnalysisPool:
29+
name: 1ES_JavaTooling_Pool
30+
image: 1ES_JavaTooling_Windows_2022
31+
os: windows
32+
customBuildTags:
33+
- MigrationTooling-mseng-VSJava-13463-Tool
34+
stages:
35+
- stage: Build
36+
jobs:
37+
- job: Job_1
38+
displayName: Agent job 1
39+
templateContext:
40+
outputs:
41+
- output: pipelineArtifact
42+
artifactName: extension
43+
targetPath: $(Build.ArtifactStagingDirectory)
44+
displayName: "Publish Artifact: extension"
45+
steps:
46+
- checkout: self
47+
clean: true
48+
fetchTags: true
49+
- task: NodeTool@0
50+
displayName: Use Node 16.x
51+
inputs:
52+
versionSpec: 16.x
53+
- task: JavaToolInstaller@0
54+
displayName: Use Java 17
55+
inputs:
56+
versionSpec: "17"
57+
jdkArchitectureOption: x64
58+
jdkSourceOption: PreInstalled
59+
- task: Npm@1
60+
displayName: npm install
61+
inputs:
62+
verbose: false
63+
- task: Bash@3
64+
displayName: npx gulp build_server
65+
inputs:
66+
targetType: inline
67+
script: |-
68+
# Build the jars to the server folder.
69+
npm run build-server
70+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
71+
displayName: ESRP CodeSigning
72+
inputs:
73+
ConnectedServiceName: vscjavaci_codesign
74+
FolderPath: server
75+
Pattern: com.microsoft.jdtls.ext.*.jar
76+
signConfigType: inlineSignParams
77+
inlineOperation: |-
78+
[
79+
{
80+
"KeyCode" : "CP-447347-Java",
81+
"OperationCode" : "JavaSign",
82+
"Parameters" : {
83+
"SigAlg" : "SHA256withRSA",
84+
"Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp"
85+
},
86+
"ToolName" : "sign",
87+
"ToolVersion" : "1.0"
88+
},
89+
{
90+
"KeyCode" : "CP-447347-Java",
91+
"OperationCode" : "JavaVerify",
92+
"Parameters" : {},
93+
"ToolName" : "sign",
94+
"ToolVersion" : "1.0"
95+
}
96+
]
97+
- task: Bash@3
98+
displayName: Replace AI key
99+
inputs:
100+
targetType: inline
101+
script: npx json@9.0.6 -I -f package.json -e "this.aiKey=\"$AI_KEY\""
102+
- task: Bash@3
103+
displayName: Bash Script
104+
inputs:
105+
targetType: inline
106+
script: |-
107+
node ./scripts/prepare-nightly-build.js
108+
mv ./package.insiders.json ./package.json
109+
- task: Bash@3
110+
displayName: vsce package --pre-release
111+
inputs:
112+
targetType: inline
113+
script: npx @vscode/vsce@latest package --pre-release
114+
- task: CopyFiles@2
115+
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
116+
inputs:
117+
Contents: "*.vsix"
118+
TargetFolder: $(Build.ArtifactStagingDirectory)

.azure-pipelines/rc.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: $(Date:yyyyMMdd).$(Rev:r)
2+
variables:
3+
- name: Codeql.Enabled
4+
value: true
5+
resources:
6+
repositories:
7+
- repository: self
8+
type: git
9+
ref: refs/heads/main
10+
- repository: 1esPipelines
11+
type: git
12+
name: 1ESPipelineTemplates/1ESPipelineTemplates
13+
ref: refs/tags/release
14+
trigger: none
15+
extends:
16+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
17+
parameters:
18+
pool:
19+
os: linux
20+
name: 1ES_JavaTooling_Pool
21+
image: 1ES_JavaTooling_Ubuntu-2004
22+
sdl:
23+
sourceAnalysisPool:
24+
name: 1ES_JavaTooling_Pool
25+
image: 1ES_JavaTooling_Windows_2022
26+
os: windows
27+
customBuildTags:
28+
- MigrationTooling-mseng-VSJava-9019-Tool
29+
stages:
30+
- stage: Build
31+
jobs:
32+
- job: Job_1
33+
displayName: RC
34+
templateContext:
35+
outputs:
36+
- output: pipelineArtifact
37+
artifactName: extension
38+
targetPath: $(Build.ArtifactStagingDirectory)
39+
displayName: "Publish Artifact: extension"
40+
steps:
41+
- checkout: self
42+
clean: true
43+
fetchTags: true
44+
- task: NodeTool@0
45+
displayName: Use Node 16.x
46+
inputs:
47+
versionSpec: 16.x
48+
- task: JavaToolInstaller@0
49+
displayName: Use Java 17
50+
inputs:
51+
versionSpec: "17"
52+
jdkArchitectureOption: x64
53+
jdkSourceOption: PreInstalled
54+
- task: Npm@1
55+
displayName: npm install
56+
inputs:
57+
verbose: false
58+
- task: Bash@3
59+
displayName: npx gulp build_server
60+
inputs:
61+
targetType: inline
62+
script: |-
63+
# Build the jars to the server folder.
64+
npm run build-server
65+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
66+
displayName: ESRP CodeSigning
67+
inputs:
68+
ConnectedServiceName: vscjavaci_codesign
69+
FolderPath: server
70+
Pattern: com.microsoft.jdtls.ext.*.jar
71+
signConfigType: inlineSignParams
72+
inlineOperation: |-
73+
[
74+
{
75+
"KeyCode" : "CP-447347-Java",
76+
"OperationCode" : "JavaSign",
77+
"Parameters" : {
78+
"SigAlg" : "SHA256withRSA",
79+
"Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp"
80+
},
81+
"ToolName" : "sign",
82+
"ToolVersion" : "1.0"
83+
},
84+
{
85+
"KeyCode" : "CP-447347-Java",
86+
"OperationCode" : "JavaVerify",
87+
"Parameters" : {},
88+
"ToolName" : "sign",
89+
"ToolVersion" : "1.0"
90+
}
91+
]
92+
- task: Bash@3
93+
displayName: Replace AI key
94+
inputs:
95+
targetType: inline
96+
script: npx json@9.0.6 -I -f package.json -e "this.aiKey=\"$AI_KEY\""
97+
- task: Bash@3
98+
displayName: vsce package
99+
inputs:
100+
targetType: inline
101+
script: npx @vscode/vsce@latest package
102+
- task: CopyFiles@2
103+
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
104+
inputs:
105+
Contents: "*.vsix"
106+
TargetFolder: $(Build.ArtifactStagingDirectory)

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ scripts
1717
extension.bundle.ts
1818
javaConfig.json
1919
.github/**
20+
.azure-pipelines/**
2021
images
2122
test-resources
2223

0 commit comments

Comments
 (0)