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

140 строки
5.5 KiB
YAML

name: $(Date:yyyyMMdd).$(Rev:r)
variables:
- name: Codeql.Enabled
value: true
schedules:
- cron: 0 3 * * *
branches:
include:
- main
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_Windows_2022
os: windows
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
stages:
- stage: Build
jobs:
- job: Job_1
displayName: VSCode-Maven-Nightly
templateContext:
outputs:
- output: pipelineArtifact
artifactName: drop
targetPath: $(Build.ArtifactStagingDirectory)
displayName: "Publish Artifact: drop"
steps:
- checkout: self
fetchTags: true
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- task: Npm@1
displayName: 'npm run tslint'
inputs:
command: custom
verbose: false
customCommand: 'run tslint'
- task: Npm@1
displayName: 'npm run compile'
inputs:
command: custom
verbose: false
customCommand: 'run compile'
- task: JavaToolInstaller@0
displayName: 'Use Java 17'
inputs:
versionSpec: 17
jdkArchitectureOption: x64
jdkSourceOption: PreInstalled
- task: Npm@1
displayName: 'npm run build-plugin'
inputs:
command: custom
verbose: false
customCommand: 'run build-plugin'
- bash: |
npx json@latest -I -f package.json -e "this.aiKey=\"$(AI_KEY)\""
displayName: Replace AI Key
- bash: |
npx json@latest -I -f package.json -e "this.version=this.version.substring(0, this.version.lastIndexOf('.'))+\".$(date -u +'%Y%m%d%H')\""
displayName: Update patch version in package.json
- script: 'npx @vscode/vsce@latest package --pre-release -o extension.vsix'
displayName: 'package vsix'
### Copy files for APIScan
- task: CopyFiles@2
displayName: "Copy Files for APIScan"
inputs:
Contents: "*.vsix"
TargetFolder: $(Agent.TempDirectory)/APIScanFiles
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
### Run latest version of APIScan listed at https://www.1eswiki.com/wiki/APIScan_Build_Task
- task: APIScan@2
displayName: Run APIScan
inputs:
softwareFolder: $(Agent.TempDirectory)/APIScanFiles
softwareName: "vscode-maven"
softwareVersionNum: "$(Build.BuildId)"
isLargeApp: false
toolVersion: "Latest"
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
env:
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
- script: npx @vscode/vsce@latest generate-manifest -i extension.vsix -o extension.manifest
displayName: 'Generate extension manifest'
- script: cp extension.manifest extension.signature.p7s
displayName: 'Prepare manifest for signing'
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
inputs:
ConnectedServiceName: $(EsrpConnectionServiceName)
AppRegistrationClientId: $(AppRegistrationClientId)
AppRegistrationTenantId: $(AppRegistrationTenantId)
AuthAKVName: $(AuthAKVName)
AuthCertName: $(AuthCertName)
AuthSignCertName: $(AuthSignCertName)
FolderPath: '.'
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 Files to: $(Build.ArtifactStagingDirectory)'
inputs:
Contents: |
extension.vsix
extension.manifest
extension.signature.p7s
TargetFolder: '$(Build.ArtifactStagingDirectory)'