vscode-gradle/.azure-pipelines/vscode-gradle-nightly.yml

232 строки
9.7 KiB
YAML

name: $(Date:yyyyMMdd).$(Rev:r)
schedules:
- cron: 0 2 * * *
branches:
include:
- develop
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
trigger: none
pr: none
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Ubuntu-2004
os: linux
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
spotBugs:
enabled: false
stages:
- stage: Build
jobs:
- job: Job_1
displayName: VSCode-Gradle-Nightly
templateContext:
outputs:
- output: pipelineArtifact
artifactName: extension
targetPath: $(Build.ArtifactStagingDirectory)
displayName: "Publish Artifact: extension"
steps:
- checkout: self
fetchTags: true
- task: JavaToolInstaller@0
displayName: Install Java 17
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: NodeTool@0
displayName: Install Node 18.x
inputs:
versionSpec: 18.x
- task: DownloadBuildArtifacts@1
displayName: 'Download Build Server Artifacts'
inputs:
buildType: specific
project: 'a4d27ce2-a42d-4b71-8eef-78cee9a9728e'
pipeline: 16493
downloadType: specific
extractTars: false
- task: CopyFiles@2
displayName: 'Copy Build Server Plugin Artifacts'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/build-server/server/build/libs/plugins'
Contents: '**'
TargetFolder: $(Build.SourcesDirectory)/extension/server/plugins
- task: CopyFiles@2
displayName: 'Copy Build Server Artifacts'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/build-server/server/build/libs'
Contents: 'server.jar'
TargetFolder: $(Build.SourcesDirectory)/gradle-server/build/libs
- task: CopyFiles@2
displayName: 'Copy Build Server Runtime Artifacts'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/build-server/server/build/libs/runtime'
Contents: '**'
TargetFolder: $(Build.SourcesDirectory)/gradle-server/build/libs/runtime
- task: Gradle@3
displayName: Build
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: 'build'
- task: Gradle@3
displayName: PrepareForRelease
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: 'prepareForRelease'
- bash: chmod +x gradle-server
workingDirectory: $(Build.SourcesDirectory)/extension/lib
displayName: Set permission
- task: EsrpCodeSigning@5
displayName: 'ESRP CodeSigning'
inputs:
ConnectedServiceName: $(ConnectedServiceName)
AppRegistrationClientId: $(AppRegistrationClientId)
AppRegistrationTenantId: $(AppRegistrationTenantId)
AuthAKVName: $(AuthAKVName)
AuthCertName: $(AuthCertName)
AuthSignCertName: $(AuthSignCertName)
FolderPath: 'extension/lib'
Pattern: 'gradle-server.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"
}
]
- bash: npx json@latest -I -f package.json -e "this.aiKey=\"$(AI_KEY)\""
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Replace AI Key
- bash: |
node ./scripts/prepare-nightly-build.js
mv ./package.insiders.json ./package.json
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Generate new package.json
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
- task: notice@0
displayName: 'NOTICE File Generator'
inputs:
outputformat: 'text'
- task: DownloadPipelineArtifact@2
displayName: Download NOTICE file
inputs:
artifact: 'NOTICE.txt'
path: $(Build.SourcesDirectory)/extension
- task: Gradle@3
displayName: Build Gradle Build Server Importer
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: ':extension:copyJdtlsPluginJar'
- task: EsrpCodeSigning@5
displayName: 'ESRP CodeSigning'
inputs:
ConnectedServiceName: $(ConnectedServiceName)
AppRegistrationClientId: $(AppRegistrationClientId)
AppRegistrationTenantId: $(AppRegistrationTenantId)
AuthAKVName: $(AuthAKVName)
AuthCertName: $(AuthCertName)
AuthSignCertName: $(AuthSignCertName)
FolderPath: 'extension/server'
Pattern: 'com.microsoft.gradle.bs.importer-*.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"
}
]
- bash: npx @vscode/vsce@latest package --pre-release -o extension.vsix
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Package VSIX
- bash: npx @vscode/vsce@latest generate-manifest -i extension.vsix -o extension.manifest
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: 'Generate extension manifest'
- bash: cp extension.manifest extension.signature.p7s
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: 'Prepare manifest for signing'
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
inputs:
ConnectedServiceName: $(ConnectedServiceName)
AppRegistrationClientId: $(AppRegistrationClientId)
AppRegistrationTenantId: $(AppRegistrationTenantId)
AuthAKVName: $(AuthAKVName)
AuthCertName: $(AuthCertName)
AuthSignCertName: $(AuthSignCertName)
FolderPath: 'extension'
Pattern: 'extension.signature.p7s'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "VSCodePublisherSign",
"parameters" : [],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 90
MaxConcurrency: 25
MaxRetryAttempts: 5
PendingAnalysisWaitTimeoutMinutes: 5
displayName: 'Sign extension'
- task: CopyFiles@2
displayName: Copy VSIX
inputs:
Contents: |
extension/extension.vsix
extension/extension.manifest
extension/extension.signature.p7s
TargetFolder: '$(Build.ArtifactStagingDirectory)'