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

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

- powershell: |
J
Joao Moreno 已提交
11
    . build/tfs/win32/exec.ps1
J
Joao Moreno 已提交
12 13 14 15 16
    $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 已提交
17 18 19 20 21 22
    exec { yarn }
    exec { npm run gulp -- hygiene }
    exec { npm run monaco-compile-check }
    exec { npm run gulp -- mixin }
    exec { node build/tfs/common/installDistro.js }
    exec { node build/lib/builtInExtensions.js }
J
Joao Moreno 已提交
23 24

- powershell: |
J
Joao Moreno 已提交
25
    . build/tfs/win32/exec.ps1
J
Joao Moreno 已提交
26 27
    $ErrorActionPreference = "Stop"
    $env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
J
Joao Moreno 已提交
28
    exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-min" }
J
Joao Moreno 已提交
29
    exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-inno-updater" }
J
Joao Moreno 已提交
30 31 32
  name: build

- powershell: |
J
Joao Moreno 已提交
33
    . build/tfs/win32/exec.ps1
J
Joao Moreno 已提交
34
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
35 36
    exec { npm run gulp -- "electron-$(VSCODE_ARCH)" }
    exec { .\scripts\test.bat --build --tfs "Unit Tests" }
J
Joao Moreno 已提交
37 38 39 40 41 42 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 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
    # 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-229803",
          "operationSetCode": "SigntoolSign",
          "parameters": [
            {
              "parameterName": "OpusName",
              "parameterValue": "VS Code"
            },
            {
              "parameterName": "OpusInfo",
              "parameterValue": "https://code.visualstudio.com/"
            },
            {
              "parameterName": "PageHash",
              "parameterValue": "/NPH"
            },
            {
              "parameterName": "TimeStamp",
              "parameterValue": "/t \"http://ts4096.gtm.microsoft.com/TSS/AuthenticodeTS\""
            }
          ],
          "toolName": "sign",
          "toolVersion": "1.0"
        },
        {
          "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\tfs\win32\ESRPClient\packages.config'
    feedsToUse: config
    nugetConfigPath: 'build\tfs\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 已提交
135
    .\build\tfs\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(ESRP_AUTH_CERTIFICATE) -AuthCertificateKey $(ESRP_AUTH_CERTIFICATE_KEY)
J
Joao Moreno 已提交
136 137 138
  displayName: Import ESRP Auth Certificate

- powershell: |
J
Joao Moreno 已提交
139
    . build/tfs/win32/exec.ps1
J
Joao Moreno 已提交
140
    $ErrorActionPreference = "Stop"
J
Joao Moreno 已提交
141
    exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-archive" "vscode-win32-$(VSCODE_ARCH)-system-setup" "vscode-win32-$(VSCODE_ARCH)-user-setup" }
J
Joao Moreno 已提交
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159

    $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 已提交
160 161 162
    exec { node build/tfs/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$(VSCODE_ARCH)-$Version.zip" $Version true $Zip }
    exec { node build/tfs/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $SystemExe }
    exec { node build/tfs/common/publish.js $Quality "$global:assetPlatform-user" setup "VSCodeUserSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $UserExe }
J
Joao Moreno 已提交
163 164 165

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