product-build-win32.yml 5.0 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
    $env:npm_config_arch="$(VSCODE_ARCH)"
    $env:CHILD_CONCURRENCY="1"
J
Joao Moreno 已提交
27 28 29 30 31 32 33

    exec { git config user.email "vscode@microsoft.com" }
    exec { git config user.name "VSCode" }
    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 已提交
34
    exec { yarn }
J
Joao Moreno 已提交
35 36 37
    exec { yarn gulp mixin }
    exec { yarn gulp hygiene }
    exec { yarn monaco-compile-check }
38 39
    exec { node build/azure-pipelines/common/installDistroDependencies.js }
    exec { node build/azure-pipelines/common/installDistroDependencies.js remote }
J
Joao Moreno 已提交
40
    exec { node build/lib/builtInExtensions.js }
J
Joao Moreno 已提交
41
  displayName: Prepare build
J
Joao Moreno 已提交
42

J
Joao Moreno 已提交
43 44 45
- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
46
    $env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
J
Joao Moreno 已提交
47 48
    .\build\azure-pipelines\win32\build.ps1
  displayName: Build
J
Joao Moreno 已提交
49 50 51 52

- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
53
    exec { yarn gulp "electron-$(VSCODE_ARCH)" }
J
Joao Moreno 已提交
54 55
    exec { .\scripts\test.bat --build --tfs "Unit Tests" }
    # yarn smoketest -- --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
J
Joao Moreno 已提交
56
  displayName: Run unit tests
D
Daniel Imms 已提交
57 58 59 60

- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
61
    exec { yarn gulp "electron-$(VSCODE_ARCH)" }
D
Daniel Imms 已提交
62
    exec { .\scripts\test-integration.bat --build --tfs "Integration Tests" }
J
Joao Moreno 已提交
63
  displayName: Run integration tests
J
Joao Moreno 已提交
64 65 66 67

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
  inputs:
    ConnectedServiceName: 'ESRP CodeSign'
A
Alex Dima 已提交
68
    FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH),$(agent.builddirectory)/vscode-reh-win32-$(VSCODE_ARCH)'
J
Joao Moreno 已提交
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
    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 已提交
136
    .\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(esrp-auth-certificate) -AuthCertificateKey $(esrp-auth-certificate-key)
J
Joao Moreno 已提交
137 138 139 140 141
  displayName: Import ESRP Auth Certificate

- powershell: |
    . build/azure-pipelines/win32/exec.ps1
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
142
    $env:AZURE_STORAGE_ACCESS_KEY_2 = "$(vscode-storage-key)"
J
build  
Joao Moreno 已提交
143
    $env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
J
Joao Moreno 已提交
144
    $env:VSCODE_HOCKEYAPP_TOKEN = "$(vscode-hockeyapp-token)"
J
Joao Moreno 已提交
145 146
    .\build\azure-pipelines\win32\publish.ps1
  displayName: Publish
J
Joao Moreno 已提交
147 148 149 150

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