Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Migrate to 1ES pipeline #814

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .azure-pipelines/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: $(Date:yyyyMMdd).$(Rev:r)
variables:
- name: Codeql.Enabled
value: true
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
trigger:
branches:
include:
- main
extends:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
parameters:
pool:
os: linux
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Ubuntu-2004
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
customBuildTags:
- MigrationTooling-mseng-VSJava-9020-Tool
stages:
- stage: Build
jobs:
- job: Job_1
displayName: CI
templateContext:
outputs:
- output: pipelineArtifact
artifactName: extension
targetPath: $(Build.ArtifactStagingDirectory)
displayName: "Publish Artifact: extension"
steps:
- checkout: self
fetchTags: false
- task: JavaToolInstaller@0
displayName: Use Java 17
inputs:
versionSpec: "17"
jdkArchitectureOption: x64
jdkSourceOption: PreInstalled
- task: NodeTool@0
displayName: Use Node 16.x
inputs:
versionSpec: 16.x
- task: Npm@1
displayName: npm install
inputs:
verbose: true
- task: Npm@1
displayName: npm run build-server
inputs:
command: custom
verbose: false
customCommand: run build-server
- task: Bash@3
displayName: vsce package
inputs:
targetType: inline
script: |-
cd $(Build.SourcesDirectory)

npx @vscode/vsce@latest package
- task: CopyFiles@2
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
inputs:
Contents: "*.vsix"
TargetFolder: $(Build.ArtifactStagingDirectory)
118 changes: 118 additions & 0 deletions .azure-pipelines/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: $(Date:yyyyMMdd).$(Rev:r)
variables:
- name: Codeql.Enabled
value: true
schedules:
- cron: 0 0 * * *
branches:
include:
- refs/heads/main
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
trigger: none
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
os: linux
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Ubuntu-2004
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
customBuildTags:
- MigrationTooling-mseng-VSJava-13463-Tool
stages:
- stage: Build
jobs:
- job: Job_1
displayName: Agent job 1
templateContext:
outputs:
- output: pipelineArtifact
artifactName: extension
targetPath: $(Build.ArtifactStagingDirectory)
displayName: "Publish Artifact: extension"
steps:
- checkout: self
clean: true
fetchTags: true
- task: NodeTool@0
displayName: Use Node 16.x
inputs:
versionSpec: 16.x
- task: JavaToolInstaller@0
displayName: Use Java 17
inputs:
versionSpec: "17"
jdkArchitectureOption: x64
jdkSourceOption: PreInstalled
- task: Npm@1
displayName: npm install
inputs:
verbose: false
- task: Bash@3
displayName: npx gulp build_server
inputs:
targetType: inline
script: |-
# Build the jars to the server folder.
npm run build-server
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
displayName: ESRP CodeSigning
inputs:
ConnectedServiceName: vscjavaci_codesign
FolderPath: server
Pattern: com.microsoft.jdtls.ext.*.jar
signConfigType: inlineSignParams
inlineOperation: |-
[
{
"KeyCode" : "CP-447347-Java",
"OperationCode" : "JavaSign",
"Parameters" : {
"SigAlg" : "SHA256withRSA",
"Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp"
},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-447347-Java",
"OperationCode" : "JavaVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
- task: Bash@3
displayName: Replace AI key
inputs:
targetType: inline
script: npx json@9.0.6 -I -f package.json -e "this.aiKey=\"$AI_KEY\""
- task: Bash@3
displayName: Bash Script
inputs:
targetType: inline
script: |-
node ./scripts/prepare-nightly-build.js
mv ./package.insiders.json ./package.json
- task: Bash@3
displayName: vsce package --pre-release
inputs:
targetType: inline
script: npx @vscode/vsce@latest package --pre-release
- task: CopyFiles@2
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
inputs:
Contents: "*.vsix"
TargetFolder: $(Build.ArtifactStagingDirectory)
106 changes: 106 additions & 0 deletions .azure-pipelines/rc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: $(Date:yyyyMMdd).$(Rev:r)
variables:
- name: Codeql.Enabled
value: true
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
trigger: none
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
os: linux
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Ubuntu-2004
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
customBuildTags:
- MigrationTooling-mseng-VSJava-9019-Tool
stages:
- stage: Build
jobs:
- job: Job_1
displayName: RC
templateContext:
outputs:
- output: pipelineArtifact
artifactName: extension
targetPath: $(Build.ArtifactStagingDirectory)
displayName: "Publish Artifact: extension"
steps:
- checkout: self
clean: true
fetchTags: true
- task: NodeTool@0
displayName: Use Node 16.x
inputs:
versionSpec: 16.x
- task: JavaToolInstaller@0
displayName: Use Java 17
inputs:
versionSpec: "17"
jdkArchitectureOption: x64
jdkSourceOption: PreInstalled
- task: Npm@1
displayName: npm install
inputs:
verbose: false
- task: Bash@3
displayName: npx gulp build_server
inputs:
targetType: inline
script: |-
# Build the jars to the server folder.
npm run build-server
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
displayName: ESRP CodeSigning
inputs:
ConnectedServiceName: vscjavaci_codesign
FolderPath: server
Pattern: com.microsoft.jdtls.ext.*.jar
signConfigType: inlineSignParams
inlineOperation: |-
[
{
"KeyCode" : "CP-447347-Java",
"OperationCode" : "JavaSign",
"Parameters" : {
"SigAlg" : "SHA256withRSA",
"Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp"
},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-447347-Java",
"OperationCode" : "JavaVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
- task: Bash@3
displayName: Replace AI key
inputs:
targetType: inline
script: npx json@9.0.6 -I -f package.json -e "this.aiKey=\"$AI_KEY\""
- task: Bash@3
displayName: vsce package
inputs:
targetType: inline
script: npx @vscode/vsce@latest package
- task: CopyFiles@2
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
inputs:
Contents: "*.vsix"
TargetFolder: $(Build.ArtifactStagingDirectory)
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ scripts
extension.bundle.ts
javaConfig.json
.github/**
.azure-pipelines/**
images
test-resources

Expand Down
Loading