Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/build/pre-release.yml
13383 views
1
# Run on a schedule
2
trigger: none
3
pr: none
4
5
schedules:
6
- cron: '0 4 * * Mon-Fri'
7
displayName: Mon-Fri at 4:00 UTC
8
branches:
9
include:
10
- main
11
- cron: '0 16 * * Mon-Fri'
12
displayName: Mon-Fri at 16:00 UTC
13
branches:
14
include:
15
- main
16
17
resources:
18
repositories:
19
- repository: templates
20
type: github
21
name: microsoft/vscode-engineering
22
ref: main
23
endpoint: Monaco
24
25
parameters:
26
- name: customNPMRegistry
27
displayName: Custom NPM Registry (Terrapin)
28
type: boolean
29
default: true
30
- name: generateNotice
31
displayName: Generate Notice
32
type: boolean
33
default: true
34
- name: publishExtension
35
displayName: Publish Pre-Release
36
type: boolean
37
default: false
38
- name: processLocalization
39
displayName: Process Localization
40
type: boolean
41
default: true
42
43
extends:
44
template: azure-pipelines/extension/pre-release.yml@templates
45
parameters:
46
l10nSourcePaths: ./src
47
l10nShouldProcess: ${{ parameters.processLocalization }}
48
nodeVersion: 22.21.x
49
standardizedVersioning: true
50
51
cgIgnoreDirectories: $(Build.SourcesDirectory)/script
52
53
# Suppress false positive strings SG.default.* that show up in
54
# dist/extension.js after the build. The original strings come from ora.
55
vscePackageArgs: '--allow-package-secrets sendgrid'
56
57
buildSteps:
58
- task: NodeTool@0
59
inputs:
60
versionSpec: '22.21.x'
61
62
- task: AzureKeyVault@2
63
displayName: "Azure Key Vault: Get Secrets"
64
inputs:
65
azureSubscription: vscode
66
KeyVaultName: vscode-build-secrets
67
SecretsFilter: "github-distro-mixin-password"
68
69
- pwsh: |
70
"machine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$Home/_netrc" -Encoding ASCII
71
condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'))
72
displayName: Setup distro auth (Windows)
73
74
- script: |
75
mkdir -p .build
76
cat << EOF | tee ~/.netrc .build/.netrc > /dev/null
77
machine github.com
78
login vscode
79
password $(github-distro-mixin-password)
80
EOF
81
condition: and(succeeded(), not(contains(variables['Agent.OS'], 'windows')))
82
displayName: Setup distro auth (non-Windows)
83
84
- task: Cache@2
85
inputs:
86
key: '"release_build_cache" | build/.cachesalt | build/setup-emsdk.sh | package-lock.json'
87
path: .build/build_cache
88
cacheHitVar: BUILD_CACHE_RESTORED
89
displayName: Restore build cache (node modules, python packages)
90
91
- script: ./build/setup-emsdk.sh
92
displayName: Setup emsdk
93
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))
94
- script: echo '##vso[task.prependpath]/opt/dev/emsdk/upstream/emscripten'
95
displayName: Setup emsdk path 1
96
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))
97
- script: echo '##vso[task.prependpath]/opt/dev/emsdk'
98
displayName: Setup emsdk path 2
99
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))
100
101
- script: tar -xzf .build/build_cache/cache.tgz
102
condition: and(succeeded(), eq(variables.BUILD_CACHE_RESTORED, 'true'))
103
displayName: Extract build cache
104
105
- script: npm ci
106
displayName: Install dependencies
107
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))
108
109
- script: |
110
set -e
111
mkdir -p .build
112
node build/listBuildCacheFiles.js .build/build_cache_list.txt
113
mkdir -p .build/build_cache
114
tar -czf .build/build_cache/cache.tgz --files-from .build/build_cache_list.txt
115
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))
116
displayName: Create build cache archive
117
118
- pwsh: |
119
# Clone the vscode-capi repository
120
git clone https://github.com/microsoft/vscode-capi.git --depth 1 ../vscode-capi
121
122
# Run the mixin script
123
Push-Location ../vscode-capi
124
npm ci && npm run mixin
125
126
# Clean up the cloned repository
127
Pop-Location
128
Remove-Item -Recurse -Force ../vscode-capi
129
displayName: mixin
130
131
- script: npm run build -- --prerelease
132
displayName: npm run build
133
134
uploadSourceMaps:
135
enabled: true
136
137
# testPlatforms:
138
# - name: Linux
139
# nodeVersions: [16.x]
140
# - name: MacOS
141
# nodeVersions: [16.x]
142
# - name: Windows
143
# nodeVersions: [16.x]
144
145
testSteps:
146
- checkout: self
147
lfs: true
148
149
- task: NodeTool@0
150
inputs:
151
versionSpec: '22.x'
152
153
- task: AzureKeyVault@2
154
displayName: "Azure Key Vault: Get Secrets"
155
inputs:
156
azureSubscription: vscode
157
KeyVaultName: vscode-build-secrets
158
SecretsFilter: "github-distro-mixin-password"
159
160
- pwsh: |
161
"machine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$Home/_netrc" -Encoding ASCII
162
condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'))
163
displayName: Setup distro auth (Windows)
164
165
- script: |
166
mkdir -p .build
167
cat << EOF | tee ~/.netrc .build/.netrc > /dev/null
168
machine github.com
169
login vscode
170
password $(github-distro-mixin-password)
171
EOF
172
condition: and(succeeded(), not(contains(variables['Agent.OS'], 'windows')))
173
displayName: Setup distro auth (non-Windows)
174
175
- task: Cache@2
176
inputs:
177
key: '"release_build_cache" | build/.cachesalt | build/setup-emsdk.sh | package-lock.json'
178
path: .build/build_cache
179
cacheHitVar: BUILD_CACHE_RESTORED
180
displayName: Restore build cache (node modules, python packages)
181
182
- script: ./build/setup-emsdk.sh
183
displayName: Setup emsdk
184
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))
185
- script: echo '##vso[task.prependpath]/opt/dev/emsdk/upstream/emscripten'
186
displayName: Setup emsdk path 1
187
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))
188
- script: echo '##vso[task.prependpath]/opt/dev/emsdk'
189
displayName: Setup emsdk path 2
190
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))
191
192
- script: tar -xzf .build/build_cache/cache.tgz
193
condition: and(succeeded(), eq(variables.BUILD_CACHE_RESTORED, 'true'))
194
displayName: Extract build cache
195
196
- script: npm ci
197
displayName: Install dependencies
198
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))
199
200
- script: |
201
set -e
202
mkdir -p .build
203
node build/listBuildCacheFiles.js .build/build_cache_list.txt
204
mkdir -p .build/build_cache
205
tar -czf .build/build_cache/cache.tgz --files-from .build/build_cache_list.txt
206
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'))
207
displayName: Create build cache archive
208
209
- task: AzureCLI@2
210
inputs:
211
azureSubscription: 'VS Code Development WIF'
212
scriptType: 'bash'
213
scriptLocation: 'inlineScript'
214
inlineScript: npm run setup
215
displayName: npm run setup
216
217
- script: npm run setup:dotnet
218
displayName: Install dotnet cli
219
220
- script: npm run typecheck
221
displayName: npm run typecheck
222
223
- script: npm run lint
224
displayName: npm run lint
225
226
- script: npm run compile
227
displayName: npm run compile
228
229
- script: npm run test:unit
230
displayName: Run vitest unit tests
231
232
- script: npm run simulate-ci
233
displayName: Run simulation tests
234
235
- script: xvfb-run -a npm run test:extension
236
displayName: Run extension tests using VS Code
237
238
- script: npm run test:prompt
239
displayName: Run Completions Core prompt tests
240
241
- script: xvfb-run -a npm run test:completions-core
242
displayName: Run Completions Core lib tests using VS Code
243
244
- script: xvfb-run -a npm run test:sanity
245
displayName: Run extension sanity tests using VS Code
246
247
tsa:
248
config:
249
areaPath: 'Visual Studio Code Copilot Extensions'
250
serviceTreeID: '1788a767-5861-45fb-973b-c686b67c5541'
251
enabled: true
252
253
${{ if eq(parameters.customNPMRegistry, false) }}:
254
customNPMRegistry: ''
255
256
generateNotice: ${{ parameters.generateNotice }}
257
258
publishExtension: ${{ parameters.publishExtension }}
259
ghReleasePublishVSIX: true
260
ghTagPrefix: 'copilot/'
261
262