product-build-win32.yml 8.3 KB
Newer Older
J
Joao Moreno 已提交
1 2 3
steps:
- task: NodeTool@0
  inputs:
A
Alex Dima 已提交
4
    versionSpec: "10.15.1"
J
Joao Moreno 已提交
5 6 7

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
  inputs:
8
    versionSpec: "1.10.1"
J
Joao Moreno 已提交
9

J
Joao Moreno 已提交
10 11 12 13 14
- task: UsePythonVersion@0
  inputs:
    versionSpec: '2.x'
    addToPath: true

J
build  
Joao Moreno 已提交
15 16 17 18 19 20
- task: AzureKeyVault@1
  displayName: 'Azure Key Vault: Get Secrets'
  inputs:
    azureSubscription: 'vscode-builds-subscription'
    KeyVaultName: vscode

J
Joao Moreno 已提交
21
- powershell: |
J
Joao Moreno 已提交
22
    . build/azure-pipelines/win32/exec.ps1
J
Joao Moreno 已提交
23
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
24
    "machine monacotools.visualstudio.com`npassword $(devops-pat)`nmachine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
J
Joao Moreno 已提交
25 26 27

    exec { git config user.email "vscode@microsoft.com" }
    exec { git config user.name "VSCode" }
J
Joao Moreno 已提交
28 29

    mkdir .build -ea 0
J
Joao Moreno 已提交
30
    "$(VSCODE_ARCH)" | Out-File -Encoding ascii -NoNewLine .build\arch
J
Joao Moreno 已提交
31 32 33 34 35
  displayName: Prepare tooling

- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
36 37 38
    exec { git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git" }
    exec { git fetch distro }
    exec { git merge $(node -p "require('./package.json').distro") }
J
Joao Moreno 已提交
39
  displayName: Merge distro
J
Joao Moreno 已提交
40

J
Joao Moreno 已提交
41 42
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
  inputs:
J
Joao Moreno 已提交
43
    keyfile: '.build/arch, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
44 45 46
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'

J
Joao Moreno 已提交
47 48 49
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
50 51
    $env:npm_config_arch="$(VSCODE_ARCH)"
    $env:CHILD_CONCURRENCY="1"
52
    exec { yarn --frozen-lockfile }
J
Joao Moreno 已提交
53
  displayName: Install dependencies
J
Joao Moreno 已提交
54 55 56 57
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))

- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
  inputs:
J
Joao Moreno 已提交
58
    keyfile: '.build/arch, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
59 60
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'
61
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
62

J
Joao Moreno 已提交
63 64 65 66 67 68 69
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
    exec { yarn postinstall }
  displayName: Run postinstall scripts
  condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))

J
Joao Moreno 已提交
70 71 72
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
73
    exec { yarn gulp mixin }
J
Joao Moreno 已提交
74 75 76 77 78
  displayName: Mix in quality

- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
79 80
    exec { yarn gulp hygiene }
    exec { yarn monaco-compile-check }
J
Joao Moreno 已提交
81
  displayName: Run hygiene checks
J
Joao Moreno 已提交
82
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
J
Joao Moreno 已提交
83 84 85 86

- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
87 88
    exec { node build/azure-pipelines/common/installDistroDependencies.js }
    exec { node build/azure-pipelines/common/installDistroDependencies.js remote }
J
Joao Moreno 已提交
89
    exec { node build/lib/builtInExtensions.js }
J
Joao Moreno 已提交
90
  displayName: Install distro dependencies and extensions
J
Joao Moreno 已提交
91

L
Logan Ramos 已提交
92 93 94
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
95
    cd $env:BUILD_STAGINGDIRECTORY
96
    exec { git clone https://github.com/microsoft/vscode-telemetry-extractor.git }
L
Logan Ramos 已提交
97
    cd vscode-telemetry-extractor
98 99 100 101 102
    exec { git checkout f538e3157c84d1bd0b239dfc5ebccac226006d58 }
    exec { npm i }
    exec { npm run setup-extension-repos }
    exec { node .\out\cli-extract.js --sourceDir $env:BUILD_SOURCESDIRECTORY --excludedDirPattern extensions  --outputDir . --applyEndpoints --includeIsMeasurement --patchWebsiteEvents }
    exec { node .\out\cli-extract-extensions.js --sourceDir .\src\telemetry-sources --outputDir . --applyEndpoints --includeIsMeasurement }
103 104 105
    mkdir $env:BUILD_SOURCESDIRECTORY\.build\telemetry -ea 0
    mv declarations-resolved.json $env:BUILD_SOURCESDIRECTORY\.build\telemetry\telemetry-core.json
    mv declarations-extensions-resolved.json $env:BUILD_SOURCESDIRECTORY\.build\telemetry\telemetry-extensions.json
L
Logan Ramos 已提交
106 107
  displayName: Extract Telemetry

J
Joao Moreno 已提交
108 109 110
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
111
    $env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
J
Joao Moreno 已提交
112
    exec { yarn gulp compile-build }
113
    exec { yarn gulp compile-extensions-build-legacy }
J
Joao Moreno 已提交
114 115 116 117
    exec { yarn gulp compile-extensions-build }
    exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-min-ci" }
    exec { yarn gulp "vscode-reh-win32-$env:VSCODE_ARCH-min-ci" }
    exec { yarn gulp "vscode-web-win32-$env:VSCODE_ARCH-min-ci" }
J
Joao Moreno 已提交
118
    exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-inno-updater" }
J
Joao Moreno 已提交
119
  displayName: Build
J
Joao Moreno 已提交
120 121 122 123

- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
124
    exec { yarn gulp "electron-$(VSCODE_ARCH)" }
J
Joao Moreno 已提交
125
    exec { .\scripts\test.bat --build --tfs "Unit Tests" }
J
Joao Moreno 已提交
126
  displayName: Run unit tests
J
Joao Moreno 已提交
127
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
D
Daniel Imms 已提交
128 129 130 131

- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
132
    exec { yarn gulp "electron-$(VSCODE_ARCH)" }
D
Daniel Imms 已提交
133
    exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" }
J
Joao Moreno 已提交
134
  displayName: Run integration tests
J
Joao Moreno 已提交
135
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
J
Joao Moreno 已提交
136 137 138 139

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
  inputs:
    ConnectedServiceName: 'ESRP CodeSign'
A
Alex Dima 已提交
140
    FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH),$(agent.builddirectory)/vscode-reh-win32-$(VSCODE_ARCH)'
J
Joao Moreno 已提交
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
    Pattern: '*.dll,*.exe,*.node'
    signConfigType: inlineSignParams
    inlineOperation: |
      [
        {
          "keyCode": "CP-230012",
          "operationSetCode": "SigntoolSign",
          "parameters": [
            {
              "parameterName": "OpusName",
              "parameterValue": "VS Code"
            },
            {
              "parameterName": "OpusInfo",
              "parameterValue": "https://code.visualstudio.com/"
            },
            {
              "parameterName": "Append",
              "parameterValue": "/as"
            },
            {
              "parameterName": "FileDigest",
              "parameterValue": "/fd \"SHA256\""
            },
            {
              "parameterName": "PageHash",
              "parameterValue": "/NPH"
            },
            {
              "parameterName": "TimeStamp",
              "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
            }
          ],
          "toolName": "sign",
          "toolVersion": "1.0"
        },
        {
          "keyCode": "CP-230012",
          "operationSetCode": "SigntoolVerify",
          "parameters": [
            {
              "parameterName": "VerifyAll",
              "parameterValue": "/all"
            }
          ],
          "toolName": "sign",
          "toolVersion": "1.0"
        }
      ]
    SessionTimeout: 120

- task: NuGetCommand@2
  displayName: Install ESRPClient.exe
  inputs:
    restoreSolution: 'build\azure-pipelines\win32\ESRPClient\packages.config'
    feedsToUse: config
    nugetConfigPath: 'build\azure-pipelines\win32\ESRPClient\NuGet.config'
    externalFeedCredentials: 3fc0b7f7-da09-4ae7-a9c8-d69824b1819b
    restoreDirectory: packages

- task: ESRPImportCertTask@1
  displayName: Import ESRP Request Signing Certificate
  inputs:
    ESRP: 'ESRP CodeSign'

- powershell: |
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
208
    .\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(esrp-auth-certificate) -AuthCertificateKey $(esrp-auth-certificate-key)
J
Joao Moreno 已提交
209 210
  displayName: Import ESRP Auth Certificate

J
Joao Moreno 已提交
211 212 213 214 215 216 217 218 219
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
    $env:AZURE_STORAGE_ACCESS_KEY_2 = "$(vscode-storage-key)"
    $env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
    $env:VSCODE_HOCKEYAPP_TOKEN = "$(vscode-hockeyapp-token)"
    $env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
    .\build\azure-pipelines\win32\publish.ps1
  displayName: Publish
J
Joao Moreno 已提交
220 221 222 223

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
  displayName: 'Component Detection'
  continueOnError: true