product-build-darwin.yml 5.0 KB
Newer Older
J
Joao Moreno 已提交
1
steps:
J
Joao Moreno 已提交
2 3 4
- script: |
    mkdir -p .build
    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:
A
Alex Dima 已提交
24
    versionSpec: "10.15.1"
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 105
- script: |
    set -e
106 107 108
    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" \
109
    VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
D
Daniel Imms 已提交
110 111
    ./scripts/test-integration.sh --build --tfs "Integration Tests"
  displayName: Run integration tests
J
Joao Moreno 已提交
112
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
D
Daniel Imms 已提交
113

D
Daniel Imms 已提交
114 115 116 117 118 119 120
- script: |
    set -e
    cd test/smoke
    yarn compile
    cd -
    yarn smoketest --web --headless
  continueOnError: true
D
Daniel Imms 已提交
121
  displayName: Run web smoke tests
D
Daniel Imms 已提交
122
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
123

J
Joao Moreno 已提交
124 125 126 127
- script: |
    set -e
    pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
  displayName: Archive build
J
Joao Moreno 已提交
128

J
Joao Moreno 已提交
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
- 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",
          "parameters": [ ],
          "toolName": "sign",
          "toolVersion": "1.0"
        }
      ]
    SessionTimeout: 120
  displayName: Codesign
J
Joao Moreno 已提交
147

J
Joao Moreno 已提交
148 149 150 151 152 153 154 155 156
- 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
157

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