product-build-darwin.yml 7.5 KB
Newer Older
J
Joao Moreno 已提交
1
steps:
J
Joao Moreno 已提交
2 3
- script: |
    mkdir -p .build
J
Joao Moreno 已提交
4
    echo -n $BUILD_SOURCEVERSION > .build/commit
5
    echo -n $VSCODE_QUALITY > .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'

- script: |
    set -e
    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
build  
Joao Moreno 已提交
30 31 32 33 34 35
- task: AzureKeyVault@1
  displayName: 'Azure Key Vault: Get Secrets'
  inputs:
    azureSubscription: 'vscode-builds-subscription'
    KeyVaultName: vscode

J
Joao Moreno 已提交
36 37
- script: |
    set -e
J
Joao Moreno 已提交
38 39 40

    cat << EOF > ~/.netrc
    machine github.com
J
Joao Moreno 已提交
41
    login vscode
J
Joao Moreno 已提交
42
    password $(github-distro-mixin-password)
J
Joao Moreno 已提交
43 44
    EOF

J
Joao Moreno 已提交
45 46
    git config user.email "vscode@microsoft.com"
    git config user.name "VSCode"
J
Joao Moreno 已提交
47 48 49 50
  displayName: Prepare tooling

- script: |
    set -e
J
Joao Moreno 已提交
51 52 53
    git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
    git fetch distro
    git merge $(node -p "require('./package.json').distro")
J
Joao Moreno 已提交
54
  displayName: Merge distro
J
Joao Moreno 已提交
55

J
Joao Moreno 已提交
56 57
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
  inputs:
58
    keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
59 60
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'
J
Joao Moreno 已提交
61

J
Joao Moreno 已提交
62 63
- script: |
    set -e
J
Joao Moreno 已提交
64
    CHILD_CONCURRENCY=1 yarn --frozen-lockfile
J
Joao Moreno 已提交
65
  displayName: Install dependencies
J
Joao Moreno 已提交
66
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
67

J
Joao Moreno 已提交
68 69
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
  inputs:
70
    keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
71 72 73
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
74 75 76

- script: |
    set -e
J
Joao Moreno 已提交
77 78 79
    yarn postinstall
  displayName: Run postinstall scripts
  condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
80

J
Joao Moreno 已提交
81 82
- script: |
    set -e
J
Joao Moreno 已提交
83
    node build/azure-pipelines/mixin
J
Joao Moreno 已提交
84
  displayName: Mix in quality
J
Joao Moreno 已提交
85

L
Logan Ramos 已提交
86 87
- script: |
    set -e
J
Joao Moreno 已提交
88
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
J
Joao Moreno 已提交
89
      yarn gulp vscode-darwin-min-ci
J
Joao Moreno 已提交
90
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
J
Joao Moreno 已提交
91
      yarn gulp vscode-reh-darwin-min-ci
J
Joao Moreno 已提交
92
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
B
Benjamin Pasero 已提交
93
      yarn gulp vscode-reh-web-darwin-min-ci
J
Joao Moreno 已提交
94
  displayName: Build
J
Joao Moreno 已提交
95

J
Joao Moreno 已提交
96 97 98 99 100 101
- script: |
    set -e
    ./scripts/test.sh --build --tfs "Unit Tests"
    # APP_NAME="`ls $(agent.builddirectory)/VSCode-darwin | head -n 1`"
    # yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
  displayName: Run unit tests
J
Joao Moreno 已提交
102
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
J
Joao Moreno 已提交
103

D
Daniel Imms 已提交
104
- script: |
B
Benjamin Pasero 已提交
105 106 107
    # 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 已提交
108
    set -e
109 110 111
    APP_ROOT=$(agent.builddirectory)/VSCode-darwin
    APP_NAME="`ls $APP_ROOT | head -n 1`"
    INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
112
    VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
D
Daniel Imms 已提交
113 114
    ./scripts/test-integration.sh --build --tfs "Integration Tests"
  displayName: Run integration tests
J
Joao Moreno 已提交
115
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
D
Daniel Imms 已提交
116

117 118 119 120 121 122 123 124 125 126
- script: |
    set -e
    cd test/smoke
    yarn compile
    cd -
    VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin" \
    yarn smoketest --web --headless
  continueOnError: true
  displayName: Run web smoke tests
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
127

J
Joao Moreno 已提交
128 129 130
- script: |
    set -e
    pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
J
Joao Moreno 已提交
131
    cp ../VSCode-darwin.zip ../VSCode-darwin-legacy-signed.zip
J
Joao Moreno 已提交
132
  displayName: Archive build
J
Joao Moreno 已提交
133

J
Joao Moreno 已提交
134 135 136 137 138 139
- task: PublishPipelineArtifact@0
  displayName: 'Publish Pipeline Artifact'
  inputs:
    artifactName: darwin-unsigned
    targetPath: ../VSCode-darwin.zip

J
Joao Moreno 已提交
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
  inputs:
    ConnectedServiceName: 'ESRP CodeSign'
    FolderPath: '$(agent.builddirectory)'
    Pattern: 'VSCode-darwin-legacy-signed.zip'
    signConfigType: inlineSignParams
    inlineOperation: |
      [
        {
          "keyCode": "CP-401337-Apple",
          "operationSetCode": "MacAppDeveloperSign",
          "parameters": [ ],
          "toolName": "sign",
          "toolVersion": "1.0"
        }
      ]
    SessionTimeout: 60
  displayName: 'Legacy Codesign'

- script: |
    zip -d ../VSCode-darwin-legacy-signed.zip "*.pkg"
  displayName: Clean Archive

- task: PublishPipelineArtifact@0
  displayName: 'Publish Pipeline Artifact'
  inputs:
    artifactName: darwin-legacy-signed
    targetPath: ../VSCode-darwin-legacy-signed.zip

J
Joao Moreno 已提交
169 170 171 172 173 174 175 176 177 178 179
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
  inputs:
    ConnectedServiceName: 'ESRP CodeSign'
    FolderPath: '$(agent.builddirectory)'
    Pattern: 'VSCode-darwin.zip'
    signConfigType: inlineSignParams
    inlineOperation: |
      [
        {
          "keyCode": "CP-401337-Apple",
          "operationSetCode": "MacAppDeveloperSign",
J
Joao Moreno 已提交
180 181 182 183 184 185
          "parameters": [
            {
              "parameterName": "Hardening",
              "parameterValue": "--options=runtime"
            }
          ],
J
Joao Moreno 已提交
186 187 188 189
          "toolName": "sign",
          "toolVersion": "1.0"
        }
      ]
J
Joao Moreno 已提交
190
    SessionTimeout: 60
J
Joao Moreno 已提交
191
  displayName: Codesign
J
Joao Moreno 已提交
192

J
Joao Moreno 已提交
193 194 195 196
- script: |
    zip -d ../VSCode-darwin.zip "*.pkg"
  displayName: Clean Archive

J
Joao Moreno 已提交
197 198 199 200 201 202
- task: PublishPipelineArtifact@0
  displayName: 'Publish Pipeline Artifact'
  inputs:
    artifactName: darwin-signed
    targetPath: ../VSCode-darwin.zip

J
Joao Moreno 已提交
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
  inputs:
    ConnectedServiceName: 'ESRP CodeSign'
    FolderPath: '$(agent.builddirectory)'
    Pattern: 'VSCode-darwin.zip'
    signConfigType: inlineSignParams
    inlineOperation: |
      [
        {
          "keyCode": "CP-401337-Apple",
          "operationSetCode": "MacAppNotarize",
          "parameters": [
            {
              "parameterName": "BundleId",
              "parameterValue": "com.microsoft.VSCodeInsiders"
            }
          ],
          "toolName": "sign",
          "toolVersion": "1.0"
        }
      ]
    SessionTimeout: 120
  displayName: Notarization
J
Joao Moreno 已提交
226

J
Joao Moreno 已提交
227 228 229 230 231 232
- task: PublishPipelineArtifact@0
  displayName: 'Publish Pipeline Artifact'
  inputs:
    artifactName: darwin-notarized
    targetPath: ../VSCode-darwin.zip

J
Joao Moreno 已提交
233 234 235 236 237 238 239 240 241
- script: |
    set -e
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
    AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
    AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
    AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
    VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
    ./build/azure-pipelines/darwin/publish.sh
  displayName: Publish
242

J
Joao Moreno 已提交
243 244 245
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
  displayName: 'Component Detection'
  continueOnError: true