product-build-win32.yml 5.8 KB
Newer Older
J
Joao Moreno 已提交
1 2 3
steps:
- task: NodeTool@0
  inputs:
4
    versionSpec: "8.12.0"
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
Joao Moreno 已提交
15
- powershell: |
J
Joao Moreno 已提交
16
    . build/azure-pipelines/win32/exec.ps1
J
Joao Moreno 已提交
17 18 19 20 21
    $ErrorActionPreference = "Stop"
    "machine monacotools.visualstudio.com password $(VSO_PAT)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
    $env:npm_config_arch="$(VSCODE_ARCH)"
    $env:CHILD_CONCURRENCY="1"
    $env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
J
Joao Moreno 已提交
22 23 24
    exec { yarn }
    exec { npm run gulp -- hygiene }
    exec { npm run monaco-compile-check }
25
    exec { npm run strict-null-check }
J
Joao Moreno 已提交
26
    exec { npm run gulp -- mixin }
J
Joao Moreno 已提交
27
    exec { node build/azure-pipelines/common/installDistro.js }
J
Joao Moreno 已提交
28
    exec { node build/lib/builtInExtensions.js }
J
Joao Moreno 已提交
29 30

- powershell: |
J
Joao Moreno 已提交
31
    . build/azure-pipelines/win32/exec.ps1
J
Joao Moreno 已提交
32 33
    $ErrorActionPreference = "Stop"
    $env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
J
Joao Moreno 已提交
34
    exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-min" }
J
Joao Moreno 已提交
35
    exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-inno-updater" }
J
Joao Moreno 已提交
36 37 38
  name: build

- powershell: |
J
Joao Moreno 已提交
39
    . build/azure-pipelines/win32/exec.ps1
J
Joao Moreno 已提交
40
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
41 42
    exec { npm run gulp -- "electron-$(VSCODE_ARCH)" }
    exec { .\scripts\test.bat --build --tfs "Unit Tests" }
J
Joao Moreno 已提交
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 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
    # yarn smoketest -- --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
  name: test

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
  inputs:
    ConnectedServiceName: 'ESRP CodeSign'
    FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)'
    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:
J
Joao Moreno 已提交
104
    restoreSolution: 'build\azure-pipelines\win32\ESRPClient\packages.config'
J
Joao Moreno 已提交
105
    feedsToUse: config
J
Joao Moreno 已提交
106
    nugetConfigPath: 'build\azure-pipelines\win32\ESRPClient\NuGet.config'
J
Joao Moreno 已提交
107 108 109 110 111 112 113 114 115 116
    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 已提交
117
    .\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(ESRP_AUTH_CERTIFICATE) -AuthCertificateKey $(ESRP_AUTH_CERTIFICATE_KEY)
J
Joao Moreno 已提交
118 119 120
  displayName: Import ESRP Auth Certificate

- powershell: |
J
Joao Moreno 已提交
121
    . build/azure-pipelines/win32/exec.ps1
J
Joao Moreno 已提交
122
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
123
    exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-archive" "vscode-win32-$(VSCODE_ARCH)-system-setup" "vscode-win32-$(VSCODE_ARCH)-user-setup" --sign }
J
Joao Moreno 已提交
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141

    $Repo = "$(pwd)"
    $Root = "$Repo\.."
    $SystemExe = "$Repo\.build\win32-$(VSCODE_ARCH)\system-setup\VSCodeSetup.exe"
    $UserExe = "$Repo\.build\win32-$(VSCODE_ARCH)\user-setup\VSCodeSetup.exe"
    $Zip = "$Repo\.build\win32-$(VSCODE_ARCH)\archive\VSCode-win32-$(VSCODE_ARCH).zip"
    $Build = "$Root\VSCode-win32-$(VSCODE_ARCH)"

    # get version
    $PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
    $Version = $PackageJson.version
    $Quality = "$env:VSCODE_QUALITY"
    $env:AZURE_STORAGE_ACCESS_KEY_2 = "$(AZURE_STORAGE_ACCESS_KEY_2)"
    $env:MOONCAKE_STORAGE_ACCESS_KEY = "$(MOONCAKE_STORAGE_ACCESS_KEY)"
    $env:AZURE_DOCUMENTDB_MASTERKEY = "$(AZURE_DOCUMENTDB_MASTERKEY)"

    $assetPlatform = if ("$(VSCODE_ARCH)" -eq "ia32") { "win32" } else { "win32-x64" }

J
Joao Moreno 已提交
142 143 144
    exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$(VSCODE_ARCH)-$Version.zip" $Version true $Zip }
    exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $SystemExe }
    exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform-user" setup "VSCodeUserSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $UserExe }
J
Joao Moreno 已提交
145 146 147

    # publish hockeyapp symbols
    $hockeyAppId = if ("$(VSCODE_ARCH)" -eq "ia32") { "$(VSCODE_HOCKEYAPP_ID_WIN32)" } else { "$(VSCODE_HOCKEYAPP_ID_WIN64)" }
J
Joao Moreno 已提交
148
    exec { node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" $hockeyAppId }
149 150 151

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