121 lines
3.4 KiB
YAML
121 lines
3.4 KiB
YAML
name: $(date:yyyyMMdd)$(rev:.r)
|
|
trigger:
|
|
branches:
|
|
include:
|
|
- main
|
|
- release
|
|
- insiders
|
|
|
|
schedules:
|
|
- cron: 30 5 * * 0
|
|
branches:
|
|
include:
|
|
- main
|
|
always: true
|
|
|
|
resources:
|
|
repositories:
|
|
- repository: MicroBuildTemplate
|
|
type: git
|
|
name: 1ESPipelineTemplates/MicroBuildTemplate
|
|
ref: refs/tags/release
|
|
|
|
variables:
|
|
- name: Codeql.Enabled
|
|
value: true
|
|
- name: Codeql.Language
|
|
value: javascript
|
|
|
|
extends:
|
|
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
|
parameters:
|
|
pool:
|
|
name: AzurePipelines-EO
|
|
image: 1ESPT-Windows2025
|
|
os: windows
|
|
sdl:
|
|
sourceAnalysisPool:
|
|
name: AzurePipelines-EO
|
|
image: 1ESPT-Windows2025
|
|
os: windows
|
|
binskim:
|
|
preReleaseVersion: '4.3.1'
|
|
tsa:
|
|
enabled: true
|
|
config:
|
|
tsaVersion: TsaV2
|
|
codebase: NewOrUpdate
|
|
codebaseName: vscode-cpptools
|
|
tsaStamp: $(TsaProjectName)
|
|
tsaEnvironment: PROD
|
|
notificationAliases: $(TsaNotificationAlias)
|
|
codebaseAdmins: $(TsaCodebaseAdmins)
|
|
instanceUrl: $(TsaInstanceUrl)
|
|
projectName: $(TsaProjectName)
|
|
areaPath: $(TsaAreaPath)
|
|
iterationPath: $(TsaIterationPath)
|
|
alltools: true
|
|
repositoryName: vscode-cpptools
|
|
policheck:
|
|
enabled: true
|
|
featureFlags:
|
|
autoBaseline: false
|
|
settings:
|
|
networkIsolationPolicy: Permissive,CFSClean,CFSClean2,CFSClean3
|
|
|
|
stages:
|
|
- stage: build
|
|
jobs:
|
|
- job: Phase_1
|
|
displayName: Build cpptools.vsix
|
|
timeoutInMinutes: 60
|
|
cancelTimeoutInMinutes: 1
|
|
templateContext:
|
|
outputs:
|
|
- output: pipelineArtifact
|
|
displayName: 'cpptools.vsix'
|
|
condition: succeeded()
|
|
targetPath: $(Build.ArtifactStagingDirectory)\Extension
|
|
artifactName: cpptools.vsix
|
|
|
|
steps:
|
|
- checkout: self
|
|
|
|
- task: UseNode@1
|
|
displayName: Use Node 22.x
|
|
inputs:
|
|
version: 22.x
|
|
|
|
- script: IF EXIST %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc del %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc
|
|
displayName: Delete .npmrc if it exists
|
|
|
|
- script: mkdir $(Build.ArtifactStagingDirectory)\Extension
|
|
displayName: Create Extension Staging Directory
|
|
|
|
- task: Bash@3
|
|
displayName: Build files
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: |
|
|
export SRC_DIR=$(echo $BUILD_SOURCESDIRECTORY | sed 's|\\|/|g')
|
|
cd "$SRC_DIR/Extension"
|
|
npm run vsix-prepublish
|
|
if [ $? -ne 0 ]; then
|
|
echo "npm run vsix-prepublish failed, sleeping for 30s before retrying..."
|
|
sleep 30
|
|
exit 1
|
|
fi
|
|
retryCountOnTaskFailure: 3
|
|
|
|
- script: yarn install --frozen-lockfile
|
|
displayName: Install dependencies with yarn
|
|
workingDirectory: $(Build.SourcesDirectory)\Extension
|
|
|
|
- script: if not exist node_modules\@vscode\vsce-sign\bin\vsce-sign.exe (echo Missing vsce-sign.exe && exit 1)
|
|
displayName: Verify vsce-sign binary exists
|
|
workingDirectory: $(Build.SourcesDirectory)\Extension
|
|
|
|
- script: npx vsce package --yarn -o $(Build.ArtifactStagingDirectory)\Extension\cpptools.vsix
|
|
displayName: Run VSCE to package vsix
|
|
workingDirectory: $(Build.SourcesDirectory)\Extension
|