product-build-win32.yml 5.8 KB
Newer Older
J
Joao Moreno 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
steps:
- task: NodeTool@0
  inputs:
    versionSpec: "8.9.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
  inputs:
    versionSpec: "1.3.2"

- powershell: |
    $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"
    yarn
    npm run gulp -- hygiene
    npm run monaco-compile-check
    $env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
    npm run gulp -- mixin
    node build/tfs/common/installDistro.js
    node build/lib/builtInExtensions.js

- powershell: |
    $ErrorActionPreference = "Stop"
    $env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
    npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-min"
    npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-copy-inno-updater"
  name: build

- powershell: |
    $ErrorActionPreference = "Stop"
    npm run gulp -- "electron-$(VSCODE_ARCH)"
    .\scripts\test.bat --build --tfs "Unit Tests"
    # 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"
    .\build\tfs\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(ESRP_AUTH_CERTIFICATE) -AuthCertificateKey $(ESRP_AUTH_CERTIFICATE_KEY)
  displayName: Import ESRP Auth Certificate

- powershell: |
    $ErrorActionPreference = "Stop"
    npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-archive" "vscode-win32-$(VSCODE_ARCH)-system-setup" "vscode-win32-$(VSCODE_ARCH)-user-setup"

    $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" }

    node build/tfs/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$(VSCODE_ARCH)-$Version.zip" $Version true $Zip
    node build/tfs/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $SystemExe
    node build/tfs/common/publish.js $Quality "$global:assetPlatform-user" setup "VSCodeUserSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $UserExe

    # publish hockeyapp symbols
    $hockeyAppId = if ("$(VSCODE_ARCH)" -eq "ia32") { "$(VSCODE_HOCKEYAPP_ID_WIN32)" } else { "$(VSCODE_HOCKEYAPP_ID_WIN64)" }
    node build/tfs/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" $hockeyAppId