Path: blob/main/extensions/copilot/build/pre-release.yml
13383 views
# Run on a schedule1trigger: none2pr: none34schedules:5- cron: '0 4 * * Mon-Fri'6displayName: Mon-Fri at 4:00 UTC7branches:8include:9- main10- cron: '0 16 * * Mon-Fri'11displayName: Mon-Fri at 16:00 UTC12branches:13include:14- main1516resources:17repositories:18- repository: templates19type: github20name: microsoft/vscode-engineering21ref: main22endpoint: Monaco2324parameters:25- name: customNPMRegistry26displayName: �� Custom NPM Registry (Terrapin)27type: boolean28default: true29- name: generateNotice30displayName: �� Generate Notice31type: boolean32default: true33- name: publishExtension34displayName: �� Publish Pre-Release35type: boolean36default: false37- name: processLocalization38displayName: �� Process Localization39type: boolean40default: true4142extends:43template: azure-pipelines/extension/pre-release.yml@templates44parameters:45l10nSourcePaths: ./src46l10nShouldProcess: ${{ parameters.processLocalization }}47nodeVersion: 22.21.x48standardizedVersioning: true4950cgIgnoreDirectories: $(Build.SourcesDirectory)/script5152# Suppress false positive strings SG.default.* that show up in53# dist/extension.js after the build. The original strings come from ora.54vscePackageArgs: '--allow-package-secrets sendgrid'5556buildSteps:57- task: NodeTool@058inputs:59versionSpec: '22.21.x'6061- task: AzureKeyVault@262displayName: "Azure Key Vault: Get Secrets"63inputs:64azureSubscription: vscode65KeyVaultName: vscode-build-secrets66SecretsFilter: "github-distro-mixin-password"6768- pwsh: |69"machine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$Home/_netrc" -Encoding ASCII70condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'))71displayName: Setup distro auth (Windows)7273- script: |74mkdir -p .build75cat << EOF | tee ~/.netrc .build/.netrc > /dev/null76machine github.com77login vscode78password $(github-distro-mixin-password)79EOF80condition: and(succeeded(), not(contains(variables['Agent.OS'], 'windows')))81displayName: Setup distro auth (non-Windows)8283- task: Cache@284inputs:85key: '"release_build_cache" | build/.cachesalt | build/setup-emsdk.sh | package-lock.json'86path: .build/build_cache87cacheHitVar: BUILD_CACHE_RESTORED88displayName: Restore build cache (node modules, python packages)8990- script: ./build/setup-emsdk.sh91displayName: Setup emsdk92condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))93- script: echo '##vso[task.prependpath]/opt/dev/emsdk/upstream/emscripten'94displayName: Setup emsdk path 195condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))96- script: echo '##vso[task.prependpath]/opt/dev/emsdk'97displayName: Setup emsdk path 298condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))99100- script: tar -xzf .build/build_cache/cache.tgz101condition: and(succeeded(), eq(variables.BUILD_CACHE_RESTORED, 'true'))102displayName: Extract build cache103104- script: npm ci105displayName: Install dependencies106condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))107108- script: |109set -e110mkdir -p .build111node build/listBuildCacheFiles.js .build/build_cache_list.txt112mkdir -p .build/build_cache113tar -czf .build/build_cache/cache.tgz --files-from .build/build_cache_list.txt114condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))115displayName: Create build cache archive116117- pwsh: |118# Clone the vscode-capi repository119git clone https://github.com/microsoft/vscode-capi.git --depth 1 ../vscode-capi120121# Run the mixin script122Push-Location ../vscode-capi123npm ci && npm run mixin124125# Clean up the cloned repository126Pop-Location127Remove-Item -Recurse -Force ../vscode-capi128displayName: mixin129130- script: npm run build -- --prerelease131displayName: npm run build132133uploadSourceMaps:134enabled: true135136# testPlatforms:137# - name: Linux138# nodeVersions: [16.x]139# - name: MacOS140# nodeVersions: [16.x]141# - name: Windows142# nodeVersions: [16.x]143144testSteps:145- checkout: self146lfs: true147148- task: NodeTool@0149inputs:150versionSpec: '22.x'151152- task: AzureKeyVault@2153displayName: "Azure Key Vault: Get Secrets"154inputs:155azureSubscription: vscode156KeyVaultName: vscode-build-secrets157SecretsFilter: "github-distro-mixin-password"158159- pwsh: |160"machine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$Home/_netrc" -Encoding ASCII161condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'))162displayName: Setup distro auth (Windows)163164- script: |165mkdir -p .build166cat << EOF | tee ~/.netrc .build/.netrc > /dev/null167machine github.com168login vscode169password $(github-distro-mixin-password)170EOF171condition: and(succeeded(), not(contains(variables['Agent.OS'], 'windows')))172displayName: Setup distro auth (non-Windows)173174- task: Cache@2175inputs:176key: '"release_build_cache" | build/.cachesalt | build/setup-emsdk.sh | package-lock.json'177path: .build/build_cache178cacheHitVar: BUILD_CACHE_RESTORED179displayName: Restore build cache (node modules, python packages)180181- script: ./build/setup-emsdk.sh182displayName: Setup emsdk183condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))184- script: echo '##vso[task.prependpath]/opt/dev/emsdk/upstream/emscripten'185displayName: Setup emsdk path 1186condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))187- script: echo '##vso[task.prependpath]/opt/dev/emsdk'188displayName: Setup emsdk path 2189condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))190191- script: tar -xzf .build/build_cache/cache.tgz192condition: and(succeeded(), eq(variables.BUILD_CACHE_RESTORED, 'true'))193displayName: Extract build cache194195- script: npm ci196displayName: Install dependencies197condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))198199- script: |200set -e201mkdir -p .build202node build/listBuildCacheFiles.js .build/build_cache_list.txt203mkdir -p .build/build_cache204tar -czf .build/build_cache/cache.tgz --files-from .build/build_cache_list.txt205condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))206displayName: Create build cache archive207208- task: AzureCLI@2209inputs:210azureSubscription: 'VS Code Development WIF'211scriptType: 'bash'212scriptLocation: 'inlineScript'213inlineScript: npm run setup214displayName: npm run setup215216- script: npm run setup:dotnet217displayName: Install dotnet cli218219- script: npm run typecheck220displayName: npm run typecheck221222- script: npm run lint223displayName: npm run lint224225- script: npm run compile226displayName: npm run compile227228- script: npm run test:unit229displayName: Run vitest unit tests230231- script: npm run simulate-ci232displayName: Run simulation tests233234- script: xvfb-run -a npm run test:extension235displayName: Run extension tests using VS Code236237- script: npm run test:prompt238displayName: Run Completions Core prompt tests239240- script: xvfb-run -a npm run test:completions-core241displayName: Run Completions Core lib tests using VS Code242243- script: xvfb-run -a npm run test:sanity244displayName: Run extension sanity tests using VS Code245246tsa:247config:248areaPath: 'Visual Studio Code Copilot Extensions'249serviceTreeID: '1788a767-5861-45fb-973b-c686b67c5541'250enabled: true251252${{ if eq(parameters.customNPMRegistry, false) }}:253customNPMRegistry: ''254255generateNotice: ${{ parameters.generateNotice }}256257publishExtension: ${{ parameters.publishExtension }}258ghReleasePublishVSIX: true259ghTagPrefix: 'copilot/'260261262