-
Notifications
You must be signed in to change notification settings - Fork 271
/
azure-pipelines-steps-node.yml
57 lines (47 loc) · 1.68 KB
/
azure-pipelines-steps-node.yml
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
parameters:
- name: os
type: string
steps:
- task: NodeTool@0
displayName: use node $(nodeVersion)
inputs:
versionSpec: $(nodeVersion)
- task: NpmAuthenticate@0
inputs:
workingFile: .npmrc
- script: npm ci
displayName: (task-lib) npm ci
workingDirectory: node
- script: npm test
workingDirectory: node
displayName: (task-lib) npm test
# Only on Linux. For CI runs on master, automatically publish packages
- ${{ if eq(parameters.os, 'Linux') }}:
- bash: |
echo //registry.npmjs.org/:_authToken=\${NPM_TOKEN} > .npmrc
npm publish || true # Ignore publish failures, usually will happen because package already exists
displayName: (task-lib) npm publish
workingDirectory: node/_build
condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranch'], 'refs/heads/master'))
env:
NPM_TOKEN: $(npm-automation.token)
# PublishPipelineArtifact step is configured in the base template.
# See the templateContext section in the azure-pipelines.yml file
# Only on Windows. Build VstsTaskSdk for powershell
- ${{ if eq(parameters.os, 'Windows_NT') }}:
# Build step for .NET source code. This is needed to enable CodeQL for C# code
- task: DotNetCoreCLI@2
displayName: 'Build .NET project(s)'
inputs:
command: build
projects: 'powershell/CompiledHelpers/VstsTaskSdk.csproj'
arguments: '--configuration Release'
- task: NpmAuthenticate@0
inputs:
workingFile: .npmrc
- script: npm ci
displayName: (VstsTaskSdk) npm ci
workingDirectory: powershell
- script: npm test
displayName: (VstsTaskSdk) npm test
workingDirectory: powershell