1
+ # This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
2
+ # Please make sure to check all the converted content, it is your team's responsibility to make sure that the pipeline is still valid and functions as expected.
3
+ # This pipeline will be extended to the OneESPT template
4
+ # If you are not using the E+D shared hosted pool with windows-2022, replace the pool section with your hosted pool, os, and image name. If you are using a Linux image, you must specify an additional windows image for SDL: https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sdlanalysis/overview#how-to-specify-a-windows-pool-for-the-sdl-source-analysis-stage
5
+ # The Task 'PublishPipelineArtifact@1' has been converted to an output named 'Publish _build artifact' in the templateContext section.
1
6
trigger :
2
- - master
3
- - releases/*
4
-
7
+ - master
8
+ - releases/*
5
9
variables :
6
10
isMaster : $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
7
11
isRelease : $[startsWith(variables['Build.SourceBranch'], 'refs/heads/releases')]
8
-
9
12
parameters :
10
- - name : nodeVersionList
11
- type : object
12
- default : [6, 8, 10, 12, 14, 16]
13
-
14
- - name : imageList
15
- type : object
16
- default : ['windows-latest', 'ubuntu-latest']
17
-
18
- - name : publishToNpm
19
- displayName : Publish to npm
20
- type : boolean
21
- default : false
22
-
23
- stages :
24
- - stage : Build
25
- displayName : Build typed-rest-client
26
- jobs :
13
+ - name : nodeVersionList
14
+ type : object
15
+ default : [6, 8, 10, 12, 14, 16]
16
+ - name : imageList
17
+ type : object
18
+ default :
19
+ windows : ' windows-latest'
20
+ ubuntu : ' ubuntu-latest'
21
+ - name : publishToNpm
22
+ displayName : Publish to npm
23
+ type : boolean
24
+ default : false
25
+ resources :
26
+ repositories :
27
+ - repository : 1ESPipelineTemplates
28
+ type : git
29
+ name : 1ESPipelineTemplates/1ESPipelineTemplates
30
+ ref : refs/tags/release
31
+ extends :
32
+ template : v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
33
+ parameters :
34
+ sdl :
35
+ sourceAnalysisPool :
36
+ name : Azure-Pipelines-1ESPT-ExDShared
37
+ image : windows-2022
38
+ os : windows
39
+ customBuildTags :
40
+ - ES365AIMigrationTooling
41
+ stages :
42
+ - stage : Build
43
+ displayName : Build typed-rest-client
44
+ jobs :
27
45
- job : Build_and_Publish
28
46
displayName : Build and Publish artifact
29
47
pool :
30
- vmImage : ' ubuntu-20.04'
48
+ name : Azure-Pipelines-1ESPT-ExDShared
49
+ image : ubuntu-latest
50
+ os : linux
51
+ templateContext :
52
+ outputs :
53
+ - output : pipelineArtifact
54
+ displayName : ' Publish _build artifact'
55
+ targetPath : _build
56
+ artifactType : pipeline
57
+ artifactName : _build
31
58
steps :
32
- # build on node 8.x
33
- - task : NodeTool@0
34
- inputs :
35
- versionSpec : ' 8.x'
36
- displayName : Install node 8
37
-
38
- - script : npm install
39
- displayName : npm install
40
-
41
- - script : npm run build
42
- displayName : npm run build
43
-
44
- - task : PublishPipelineArtifact@1
45
- displayName : Publish _build artifact
46
- inputs :
47
- targetPath : _build
48
- artifactType : pipeline
49
- artifactName : _build
50
-
51
- # run unit tests on different platforms and node versions
52
- - stage : Test
53
- displayName : Test typed-rest-client
54
- jobs :
59
+ - task : NodeTool@0
60
+ inputs :
61
+ versionSpec : ' 8.x'
62
+ displayName : Install node 8
63
+ - script : npm install
64
+ displayName : npm install
65
+ - script : npm run build
66
+ displayName : npm run build
67
+ - stage : Test
68
+ displayName : Test typed-rest-client
69
+ jobs :
55
70
- ${{ each image in parameters.imageList }} :
56
- - ${{ each nodeVersion in parameters.nodeVersionList }} :
57
- - job : Node_os_${{ nodeVersion }}_${{ replace(image,'-','_') }}
58
- displayName : Node.js ${{ nodeVersion }} on ${{ image }}
59
- pool :
60
- vmImage : ${{ image }}
61
- steps :
62
- - task : DownloadPipelineArtifact@2
63
- displayName : Download built typed-rest-client package
64
- inputs :
65
- artifact : _build
66
- path : $(Build.SourcesDirectory)/_build
67
- patterns : ' !package-lock.json' # Exclude package-lock.json
68
-
69
- - script : npm install
70
- displayName : npm install
71
-
72
- - task : NodeTool@0
73
- inputs :
74
- versionSpec : ${{ nodeVersion }}.x
75
- displayName : Install node ${{ nodeVersion }}
76
-
77
- - script : npm run units
78
- displayName : npm run units
79
-
80
- - script : npm run test
81
- displayName : npm run test
82
-
83
- - stage : Publish
84
- condition : and(succeeded(), or(eq('${{ parameters.publishToNpm }}', true), eq(variables.isRelease, true), eq(variables.isMaster, true)))
85
- jobs :
71
+ - ${{ each nodeVersion in parameters.nodeVersionList }} :
72
+ - job : Node_os_${{ nodeVersion }}_${{ image.key }}
73
+ displayName : Node.js ${{ nodeVersion }} on ${{ image.key }}
74
+ pool :
75
+ name : Azure-Pipelines-1ESPT-ExDShared
76
+ image : ${{ image.value }}
77
+ os : ${{ image.key }}
78
+ steps :
79
+ - task : DownloadPipelineArtifact@2
80
+ displayName : Download built typed-rest-client package
81
+ inputs :
82
+ artifact : _build
83
+ path : $(Build.SourcesDirectory)/_build
84
+ patterns : ' !package-lock.json'
85
+ - script : npm install
86
+ displayName : npm install
87
+ - task : NodeTool@0
88
+ inputs :
89
+ versionSpec : ${{ nodeVersion }}.x
90
+ displayName : Install node ${{ nodeVersion }}
91
+ - script : npm run units
92
+ displayName : npm run units
93
+ - script : npm run test
94
+ displayName : npm run test
95
+ - stage : Publish
96
+ condition : and(succeeded(), or(eq('${{ parameters.publishToNpm }}', true), eq(variables.isRelease, true), eq(variables.isMaster, true)))
97
+ jobs :
86
98
- job : Publish_package
87
99
displayName : Publish npm package
88
100
pool :
89
- vmImage : ' ubuntu-20.04'
101
+ name : Azure-Pipelines-1ESPT-ExDShared
102
+ image : ubuntu-latest
103
+ os : linux
90
104
steps :
91
- - task : DownloadPipelineArtifact@2
92
- displayName : Download built typed-rest-client package
93
- inputs :
94
- artifact : _build
95
- path : $(Build.SourcesDirectory)/_build
96
-
97
- - task : Npm@1
98
- displayName : Publish typed-rest-client to npm
99
- inputs :
100
- command : publish
101
- workingDir : ' _build'
102
- publishRegistry : useExternalRegistry
103
- publishEndpoint : NPM-Automation-Token
104
- continueOnError : true
105
-
106
- - script : npm install
107
- displayName : npm install
108
- continueOnError : true
109
- condition : and(succeeded(), eq(variables.isMaster, true))
110
-
111
- - script : node ./ci/create-release-notes.js
112
- continueOnError : true
113
- condition : and(succeeded(), eq(variables.isMaster, true))
114
- env :
115
- GH_TOKEN : $(githubToken)
116
- branch : $(Build.SourceBranchName)
117
- displayName : Create Release
105
+ - task : DownloadPipelineArtifact@2
106
+ displayName : Download built typed-rest-client package
107
+ inputs :
108
+ artifact : _build
109
+ path : $(Build.SourcesDirectory)/_build
110
+ - task : Npm@1
111
+ displayName : Publish typed-rest-client to npm
112
+ inputs :
113
+ command : publish
114
+ workingDir : ' _build'
115
+ publishRegistry : useExternalRegistry
116
+ publishEndpoint : NPM-Automation-Token
117
+ continueOnError : true
118
+ - script : npm install
119
+ displayName : npm install
120
+ continueOnError : true
121
+ condition : and(succeeded(), eq(variables.isMaster, true))
122
+ - script : node ./ci/create-release-notes.js
123
+ continueOnError : true
124
+ condition : and(succeeded(), eq(variables.isMaster, true))
125
+ env :
126
+ GH_TOKEN : $(githubToken)
127
+ branch : $(Build.SourceBranchName)
128
+ displayName : Create Release
0 commit comments