2019-07-03 13:31:02 +00:00
|
|
|
steps:
|
2020-11-24 10:44:18 +00:00
|
|
|
- script: |
|
|
|
|
mkdir -p .build
|
|
|
|
echo -n $BUILD_SOURCEVERSION > .build/commit
|
|
|
|
echo -n $VSCODE_QUALITY > .build/quality
|
2020-11-25 09:02:40 +00:00
|
|
|
echo -n $ENABLE_TERRAPIN > .build/terrapin
|
2020-11-30 16:46:06 +00:00
|
|
|
displayName: Prepare compilation cache flag
|
2020-11-24 10:44:18 +00:00
|
|
|
|
|
|
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
|
|
|
inputs:
|
2020-11-25 09:02:40 +00:00
|
|
|
keyfile: "build/.cachesalt, .build/commit, .build/quality, .build/terrapin"
|
2020-11-24 10:44:18 +00:00
|
|
|
targetfolder: ".build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min"
|
|
|
|
vstsFeed: "npm-vscode"
|
|
|
|
platformIndependent: true
|
|
|
|
alias: "Compilation"
|
|
|
|
dryRun: true
|
|
|
|
|
|
|
|
- task: NodeTool@0
|
|
|
|
inputs:
|
2020-12-05 09:54:58 +00:00
|
|
|
versionSpec: "12.18.3"
|
2020-11-24 10:44:18 +00:00
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|
|
|
|
|
|
|
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
|
|
|
inputs:
|
|
|
|
versionSpec: "1.x"
|
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|
|
|
|
|
|
|
|
- task: AzureKeyVault@1
|
|
|
|
displayName: "Azure Key Vault: Get Secrets"
|
|
|
|
inputs:
|
|
|
|
azureSubscription: "vscode-builds-subscription"
|
|
|
|
KeyVaultName: vscode
|
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
cat << EOF > ~/.netrc
|
|
|
|
machine github.com
|
|
|
|
login vscode
|
|
|
|
password $(github-distro-mixin-password)
|
|
|
|
EOF
|
|
|
|
|
|
|
|
git config user.email "vscode@microsoft.com"
|
|
|
|
git config user.name "VSCode"
|
|
|
|
displayName: Prepare tooling
|
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
|
|
|
|
git fetch distro
|
|
|
|
git merge $(node -p "require('./package.json').distro")
|
|
|
|
displayName: Merge distro
|
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
npx https://aka.ms/enablesecurefeed standAlone
|
|
|
|
displayName: Switch to Terrapin packages
|
2020-11-25 08:37:56 +00:00
|
|
|
timeoutInMinutes: 5
|
2020-11-25 13:56:13 +00:00
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), eq(variables['ENABLE_TERRAPIN'], 'true'))
|
2020-11-24 10:44:18 +00:00
|
|
|
|
2020-12-12 13:13:28 +00:00
|
|
|
- script: |
|
|
|
|
echo -n $(VSCODE_ARCH) > .build/arch
|
|
|
|
displayName: Prepare yarn cache flags
|
|
|
|
|
2020-11-24 10:44:18 +00:00
|
|
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
|
|
|
inputs:
|
2020-11-25 09:02:40 +00:00
|
|
|
keyfile: ".build/arch, .build/terrapin, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock"
|
2020-11-24 10:44:18 +00:00
|
|
|
targetfolder: "**/node_modules, !**/node_modules/**/node_modules"
|
|
|
|
vstsFeed: "npm-vscode"
|
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|
|
|
|
|
2020-12-12 12:45:05 +00:00
|
|
|
# TODO@Joao: remove
|
2020-11-24 10:44:18 +00:00
|
|
|
- script: |
|
|
|
|
set -e
|
2020-12-12 12:45:05 +00:00
|
|
|
echo "Restore cache should not have failed"
|
|
|
|
exit 1
|
|
|
|
displayName: Check cache restore
|
2020-11-24 10:44:18 +00:00
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), ne(variables['CacheRestored'], 'true'))
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
yarn postinstall
|
|
|
|
displayName: Run postinstall scripts
|
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), eq(variables['CacheRestored'], 'true'))
|
|
|
|
|
2020-12-11 19:28:45 +00:00
|
|
|
# Mixin must run before optimize, because the CSS loader will inline small SVGs
|
2020-11-24 10:44:18 +00:00
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
node build/azure-pipelines/mixin
|
|
|
|
displayName: Mix in quality
|
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
yarn gulp compile-build
|
|
|
|
yarn gulp compile-extensions-build
|
|
|
|
yarn gulp minify-vscode
|
|
|
|
yarn gulp minify-vscode-reh
|
|
|
|
yarn gulp minify-vscode-reh-web
|
|
|
|
displayName: Compile
|
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
|
|
|
node build/azure-pipelines/upload-sourcemaps
|
|
|
|
displayName: Upload sourcemaps
|
2020-12-11 19:28:45 +00:00
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), ne(variables['VSCODE_PUBLISH'], 'false'))
|
2020-11-24 10:44:18 +00:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
VERSION=`node -p "require(\"./package.json\").version"`
|
|
|
|
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
|
|
|
node build/azure-pipelines/common/createBuild.js $VERSION
|
|
|
|
displayName: Create build
|
2020-12-11 19:28:45 +00:00
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), ne(variables['VSCODE_PUBLISH'], 'false'))
|
2020-11-24 10:44:18 +00:00
|
|
|
|
|
|
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
|
|
|
inputs:
|
2020-11-25 09:02:40 +00:00
|
|
|
keyfile: "build/.cachesalt, .build/commit, .build/quality, .build/terrapin"
|
2020-11-24 10:44:18 +00:00
|
|
|
targetfolder: ".build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min"
|
|
|
|
vstsFeed: "npm-vscode"
|
|
|
|
platformIndependent: true
|
|
|
|
alias: "Compilation"
|
|
|
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|