Skip to content

Commit fdd9114

Browse files
AndreyIvanov42Andrey Ivanov
andauthored
Update pipeline to include a step for publishing artifacts. (#848)
* Update pipeline * Update azure-pipelines.yml * nodeversion as variable Co-authored-by: Andrey Ivanov <v-andivanov@microsoft.com>
1 parent fe44aa4 commit fdd9114

File tree

3 files changed

+49
-67
lines changed

3 files changed

+49
-67
lines changed

azure-pipelines-steps-node.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
parameters:
2+
- name: nodeVersion
3+
type: string
4+
5+
steps:
6+
# npm install
7+
- task: Npm@1
8+
displayName: (azure-pipelines-task-lib) npm install
9+
inputs:
10+
command: install
11+
workingDir: node
12+
13+
- task: NodeTool@0
14+
displayName: (azure-pipelines-task-lib) use node ${{parameters.nodeVersion}}
15+
inputs:
16+
versionSpec: ${{parameters.nodeVersion}}

azure-pipelines-steps-test-build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
steps:
2+
# test
3+
- script: node make.js test
4+
workingDirectory: node
5+
displayName: (azure-pipelines-task-lib) node make.js test
6+
7+
# build
8+
- script: node make.js build
9+
displayName: (azure-pipelines-task-lib) node make.js build
10+
workingDirectory: node

azure-pipelines.yml

Lines changed: 23 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ trigger:
33
- features/*
44
- releases/*
55

6+
variables:
7+
nodeVersion: 10.23.0
8+
69
jobs:
710
#################################################
811
- job: windows
@@ -16,31 +19,22 @@ jobs:
1619
# azure-pipelines-task-lib
1720
################################################################################
1821

19-
# npm install
20-
- task: Npm@1
21-
displayName: (azure-pipelines-task-lib) npm install
22-
inputs:
23-
command: install
24-
workingDir: node
22+
- template: azure-pipelines-steps-node.yml
23+
parameters:
24+
nodeVersion: $(nodeVersion)
2525

26-
# use node 10
27-
- task: NodeTool@0
28-
displayName: (azure-pipelines-task-lib) use node 10.23.0
29-
inputs:
30-
versionSpec: "10.23.0"
31-
32-
# build/test
26+
# test
3327
- script: |
3428
chcp 437
3529
node make.js test
3630
workingDirectory: node
3731
displayName: (azure-pipelines-task-lib) node make.js test
3832
39-
# build/test
33+
# build
4034
- script: |
4135
chcp 437
42-
node make.js test
43-
displayName: (azure-pipelines-task-lib) node make.js test
36+
node make.js build
37+
displayName: (azure-pipelines-task-lib) node make.js build
4438
workingDirectory: node
4539
4640
################################################################################
@@ -66,33 +60,17 @@ jobs:
6660
pool:
6761
vmImage: ubuntu-18.04
6862

69-
steps:
70-
################################################################################
71-
# azure-pipelines-task-lib
72-
################################################################################
73-
74-
# npm install
75-
- task: Npm@1
76-
displayName: (azure-pipelines-task-lib) npm install
77-
inputs:
78-
command: install
79-
workingDir: node
63+
steps:
64+
- template: azure-pipelines-steps-node.yml
65+
parameters:
66+
nodeVersion: $(nodeVersion)
67+
- template: azure-pipelines-steps-test-build.yml
8068

81-
# use node 10
82-
- task: NodeTool@0
83-
displayName: (azure-pipelines-task-lib) use node 10.23.0
69+
- task: PublishPipelineArtifact@1
8470
inputs:
85-
versionSpec: "10.23.0"
86-
87-
# build/test
88-
- script: node make.js test
89-
workingDirectory: node
90-
displayName: (azure-pipelines-task-lib) node make.js test
91-
92-
# build/test
93-
- script: node make.js test
94-
displayName: (azure-pipelines-task-lib) node make.js test
95-
workingDirectory: node
71+
targetPath: 'node/_build'
72+
artifactType: 'pipeline'
73+
artifactName: 'npm-package'
9674

9775
# For CI runs on master, automatically publish packages
9876
- bash: |
@@ -113,29 +91,7 @@ jobs:
11391
vmImage: macOS-10.15
11492

11593
steps:
116-
################################################################################
117-
# azure-pipelines-task-lib
118-
################################################################################
119-
120-
# npm install
121-
- task: Npm@1
122-
displayName: (azure-pipelines-task-lib) npm install
123-
inputs:
124-
command: install
125-
workingDir: node
126-
127-
# use node 10
128-
- task: NodeTool@0
129-
displayName: (azure-pipelines-task-lib) use node 10.23.0
130-
inputs:
131-
versionSpec: "10.23.0"
132-
133-
# build/test
134-
- script: node make.js test
135-
workingDirectory: node
136-
displayName: (azure-pipelines-task-lib) node make.js test
137-
138-
# build/test
139-
- script: node make.js test
140-
displayName: (azure-pipelines-task-lib) node make.js test
141-
workingDirectory: node
94+
- template: azure-pipelines-steps-node.yml
95+
parameters:
96+
nodeVersion: $(nodeVersion)
97+
- template: azure-pipelines-steps-test-build.yml

0 commit comments

Comments
 (0)