product-build-win32.yml 10.0 KB
Newer Older
J
Joao Moreno 已提交
1
steps:
J
Joao Moreno 已提交
2 3 4
- powershell: |
    mkdir .build -ea 0
    "$env:BUILD_SOURCEVERSION" | Out-File -Encoding ascii -NoNewLine .build\commit
5
    "$env:VSCODE_QUALITY" | Out-File -Encoding ascii -NoNewLine .build\quality
J
Joao Moreno 已提交
6 7 8 9
  displayName: Prepare cache flag

- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
  inputs:
10
    keyfile: 'build/.cachesalt, .build/commit, .build/quality'
11
    targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
J
Joao Moreno 已提交
12 13 14 15 16 17 18 19 20 21
    vstsFeed: 'npm-vscode'
    platformIndependent: true
    alias: 'Compilation'

- powershell: |
    $ErrorActionPreference = "Stop"
    exit 1
  displayName: Check RestoreCache
  condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'))

J
Joao Moreno 已提交
22 23
- task: NodeTool@0
  inputs:
24
    versionSpec: "12.13.0"
J
Joao Moreno 已提交
25 26 27

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
  inputs:
I
isidor 已提交
28
    versionSpec: "1.x"
J
Joao Moreno 已提交
29

J
Joao Moreno 已提交
30 31 32 33 34
- task: UsePythonVersion@0
  inputs:
    versionSpec: '2.x'
    addToPath: true

J
build  
Joao Moreno 已提交
35 36 37 38 39 40
- task: AzureKeyVault@1
  displayName: 'Azure Key Vault: Get Secrets'
  inputs:
    azureSubscription: 'vscode-builds-subscription'
    KeyVaultName: vscode

J
Joao Moreno 已提交
41
- powershell: |
J
Joao Moreno 已提交
42
    . build/azure-pipelines/win32/exec.ps1
J
Joao Moreno 已提交
43
    $ErrorActionPreference = "Stop"
44
    "machine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
J
Joao Moreno 已提交
45 46 47

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

    mkdir .build -ea 0
J
Joao Moreno 已提交
50
    "$(VSCODE_ARCH)" | Out-File -Encoding ascii -NoNewLine .build\arch
J
Joao Moreno 已提交
51 52 53 54 55
  displayName: Prepare tooling

- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
56 57 58
    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 已提交
59
  displayName: Merge distro
J
Joao Moreno 已提交
60

J
Joao Moreno 已提交
61 62
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
  inputs:
63
    keyfile: 'build/.cachesalt, .build/arch, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
64 65
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'
J
Joao Moreno 已提交
66

J
Joao Moreno 已提交
67 68 69
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
70 71
    $env:npm_config_arch="$(VSCODE_ARCH)"
    $env:CHILD_CONCURRENCY="1"
72
    exec { yarn --frozen-lockfile }
J
Joao Moreno 已提交
73
  displayName: Install dependencies
J
Joao Moreno 已提交
74
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
75

J
Joao Moreno 已提交
76 77
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
  inputs:
78
    keyfile: 'build/.cachesalt, .build/arch, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
79 80 81
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
82 83 84 85

- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
86 87 88
    exec { yarn postinstall }
  displayName: Run postinstall scripts
  condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
  env:
    OSS_GITHUB_ID: "a5d3c261b032765a78de"
    OSS_GITHUB_SECRET: $(oss-github-client-secret)
    INSIDERS_GITHUB_ID: "31f02627809389d9f111"
    INSIDERS_GITHUB_SECRET: $(insiders-github-client-secret)
    STABLE_GITHUB_ID: "baa8a44b5e861d918709"
    STABLE_GITHUB_SECRET: $(stable-github-client-secret)
    EXPLORATION_GITHUB_ID: "94e8376d3a90429aeaea"
    EXPLORATION_GITHUB_SECRET: $(exploration-github-client-secret)
    VSO_GITHUB_ID: "3d4be8f37a0325b5817d"
    VSO_GITHUB_SECRET: $(vso-github-client-secret)
    VSO_PPE_GITHUB_ID: "eabf35024dc2e891a492"
    VSO_PPE_GITHUB_SECRET: $(vso-ppe-github-client-secret)
    VSO_DEV_GITHUB_ID: "84383ebd8a7c5f5efc5c"
    VSO_DEV_GITHUB_SECRET: $(vso-dev-github-client-secret)
    GITHUB_APP_ID: "Iv1.ae51e546bef24ff1"
    GITHUB_APP_SECRET: $(github-app-client-secret)
J
Joao Moreno 已提交
106

J
Joao Moreno 已提交
107 108 109
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
110
    exec { node build/azure-pipelines/mixin }
J
Joao Moreno 已提交
111
  displayName: Mix in quality
J
Joao Moreno 已提交
112

J
Joao Moreno 已提交
113 114 115
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
116
    $env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
J
Joao Moreno 已提交
117 118
    exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-min-ci" }
    exec { yarn gulp "vscode-reh-win32-$env:VSCODE_ARCH-min-ci" }
B
Benjamin Pasero 已提交
119
    exec { yarn gulp "vscode-reh-web-win32-$env:VSCODE_ARCH-min-ci" }
J
Joao Moreno 已提交
120
    exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-code-helper" }
J
Joao Moreno 已提交
121
    exec { yarn gulp "vscode-win32-$env:VSCODE_ARCH-inno-updater" }
J
Joao Moreno 已提交
122
  displayName: Build
J
Joao Moreno 已提交
123 124 125 126

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

132 133 134 135 136 137 138
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
    exec { yarn test-browser --build --browser chromium }
  displayName: Run unit tests (Browser)
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

D
Daniel Imms 已提交
139
- powershell: |
B
Benjamin Pasero 已提交
140 141 142
    # Figure out the full absolute path of the product we just built
    # including the remote server and configure the integration tests
    # to run with these builds instead of running out of sources.
D
Daniel Imms 已提交
143 144
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
145 146 147
    $AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
    $AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
    $AppNameShort = $AppProductJson.nameShort
148
    exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"; .\scripts\test-integration.bat --build --tfs "Integration Tests" }
149 150 151
  displayName: Run integration tests (Electron)
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

B
Benjamin Pasero 已提交
152 153 154 155 156 157 158 159 160 161
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
    $AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
    $AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
    $AppNameShort = $AppProductJson.nameShort
    exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"; .\resources\server\test\test-remote-integration.bat }
  displayName: Run remote integration tests (Electron)
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

162 163 164
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
165
    exec { $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-web-win32-$(VSCODE_ARCH)"; .\resources\server\test\test-web-integration.bat --browser firefox }
166
  displayName: Run integration tests (Browser)
J
Joao Moreno 已提交
167
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
J
Joao Moreno 已提交
168 169 170 171

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
  inputs:
    ConnectedServiceName: 'ESRP CodeSign'
A
Alex Dima 已提交
172
    FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH),$(agent.builddirectory)/vscode-reh-win32-$(VSCODE_ARCH)'
J
Joao Moreno 已提交
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 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
    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 已提交
240
    .\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(esrp-auth-certificate) -AuthCertificateKey $(esrp-auth-certificate-key)
J
Joao Moreno 已提交
241 242
  displayName: Import ESRP Auth Certificate

J
Joao Moreno 已提交
243 244 245 246 247 248 249 250 251
- 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 已提交
252 253 254 255

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