product-build-darwin.yml 4.5 KB
Newer Older
J
Joao Moreno 已提交
1
steps:
J
Joao Moreno 已提交
2 3 4 5 6 7 8
- script: |
    mkdir -p .build
    echo -n $BUILD_SOURCEVERSION > .build/commit
  displayName: Prepare cache flag

- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
  inputs:
J
Joao Moreno 已提交
9
    keyfile: 'build/.cachesalt, .build/commit'
10
    targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
J
Joao Moreno 已提交
11 12 13 14 15 16 17 18 19 20
    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 已提交
21 22
- task: NodeTool@0
  inputs:
A
Alex Dima 已提交
23
    versionSpec: "10.15.1"
J
Joao Moreno 已提交
24 25 26

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
  inputs:
J
Joao Moreno 已提交
27
    versionSpec: "1.10.1"
J
Joao Moreno 已提交
28

J
build  
Joao Moreno 已提交
29 30 31 32 33 34
- task: AzureKeyVault@1
  displayName: 'Azure Key Vault: Get Secrets'
  inputs:
    azureSubscription: 'vscode-builds-subscription'
    KeyVaultName: vscode

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

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

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

- script: |
    set -e
J
Joao Moreno 已提交
50 51 52
    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 已提交
53
  displayName: Merge distro
J
Joao Moreno 已提交
54

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

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

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

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

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

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

J
Joao Moreno 已提交
95 96 97 98 99 100
- 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 已提交
101
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
J
Joao Moreno 已提交
102

D
Daniel Imms 已提交
103 104 105 106
- script: |
    set -e
    ./scripts/test-integration.sh --build --tfs "Integration Tests"
  displayName: Run integration tests
J
Joao Moreno 已提交
107
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
D
Daniel Imms 已提交
108

J
Joao Moreno 已提交
109 110 111 112
- script: |
    set -e
    pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
  displayName: Archive build
J
Joao Moreno 已提交
113

J
Joao Moreno 已提交
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
- 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 已提交
132

J
Joao Moreno 已提交
133 134 135 136 137 138 139 140 141
- 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
142

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