1
+ # Copyright (c) Microsoft Corporation.
2
+ # Licensed under the MIT License.
3
+ #
4
+ # The Release pipeline to publish NPM and NuGet packages
5
+ # to public ADO feeds and to npmjs.com and Nuget.org feeds.
6
+ #
7
+
1
8
trigger : none
2
9
name : $(Date:yyyyMMdd).$(Rev:r)
10
+
3
11
resources :
4
12
pipelines :
5
- - pipeline : ' _microsoftnode -api-dotnet '
13
+ - pipeline : ' microsoft_node -api-dotnet_ci '
6
14
project : ' ISS'
7
- source : ' microsoft.node-api-dotnet'
15
+ source : ' microsoft.node-api-dotnet.ci '
8
16
trigger :
9
17
branches :
10
18
include :
11
19
- main
20
+
12
21
repositories :
13
22
- repository : CustomPipelineTemplates
14
23
type : git
15
24
name : 1ESPipelineTemplates/OfficePipelineTemplates
16
25
ref : refs/tags/release
26
+
17
27
extends :
18
28
template : v1/Office.Official.PipelineTemplate.yml@CustomPipelineTemplates
19
29
parameters :
@@ -23,26 +33,34 @@ extends:
23
33
os : windows
24
34
customBuildTags :
25
35
- ES365AIMigrationTooling-BulkMigrated-Release
26
- stages :
36
+ sdl :
37
+ eslint :
38
+ enableExclusions : true
39
+ # This repo does not ship any javascript code. But has many test cases for the js engine that fail parsing, have code considered insecure and crash eslint.
40
+ exclusionPatterns : |
41
+ '**/*.*'
27
42
43
+ stages :
28
44
- stage : ms_react_native_nuget_publish
29
45
displayName : Nuget ms/react-native feed
30
46
jobs :
31
47
- job : ms_react_native_nuget_job
32
48
displayName : Publish Nuget to ms/react-native
33
- condition : succeeded()
34
- timeoutInMinutes : 0
35
49
templateContext :
36
50
inputs :
37
51
- input : pipelineArtifact
38
- pipeline : _microsoftnode -api-dotnet
52
+ pipeline : microsoft_node -api-dotnet_ci
39
53
artifactName : published-packages
40
54
targetPath : $(Pipeline.Workspace)\published-packages
55
+
56
+ # Use 1ES.PublishNuGet task to securely publish NuGet packages to ms/react-native-public feed.
41
57
steps :
42
58
- script : dir /S $(Pipeline.Workspace)\published-packages
43
59
displayName : Show directory contents
60
+
44
61
- script : dotnet nuget list source
45
62
displayName : Show Nuget sources
63
+
46
64
- task : 1ES.PublishNuGet@1
47
65
displayName : NuGet push
48
66
inputs :
@@ -59,30 +77,36 @@ extends:
59
77
jobs :
60
78
- job : ms_react_native_npm_job
61
79
displayName : Agent job
62
- condition : succeeded()
63
- timeoutInMinutes : 0
64
80
templateContext :
65
81
inputs :
66
82
- input : pipelineArtifact
67
- pipeline : ' _microsoftnode -api-dotnet '
83
+ pipeline : microsoft_node -api-dotnet_ci
68
84
artifactName : ' published-packages'
69
85
targetPath : $(Pipeline.Workspace)\published-packages
86
+
87
+ # Use the NPM utility to authenticate and publish to ADO ms/react-native feed
70
88
steps :
71
89
- task : NodeTool@0
72
- displayName : Use Node 20 .x
90
+ displayName : Use Node 22 .x
73
91
inputs :
74
- versionSpec : 20.x
92
+ versionSpec : 22.x
93
+
75
94
- task : CmdLine@2
76
95
displayName : Setup npmrc file for react-native feed
77
96
inputs :
78
97
script : |
79
98
echo registry=https://pkgs.dev.azure.com/ms/_packaging/react-native/npm/registry/ > $(Pipeline.Workspace)\published-packages\.npmrc
80
99
echo always-auth=true >> $(Pipeline.Workspace)\published-packages\.npmrc
100
+
81
101
- task : npmAuthenticate@0
82
102
displayName : npm Authenticate .npmrc
83
103
inputs :
84
104
workingFile : $(Pipeline.Workspace)\published-packages\.npmrc
85
105
customEndpoint : Npm - ms/react-native
106
+
107
+ - script : dir /S $(Pipeline.Workspace)\published-packages
108
+ displayName : Show directory contents
109
+
86
110
- task : CmdLine@2
87
111
displayName : npm publish to react-native feed
88
112
inputs :
@@ -95,27 +119,31 @@ extends:
95
119
jobs :
96
120
- job : nuget_org_job
97
121
displayName : Publish Nuget to nuget.org
98
- condition : succeeded()
99
- timeoutInMinutes : 0
100
122
templateContext :
101
123
inputs :
102
124
- input : pipelineArtifact
103
- pipeline : ' _microsoftnode -api-dotnet '
125
+ pipeline : microsoft_node -api-dotnet_ci
104
126
artifactName : ' published-packages'
105
127
targetPath : ' $(Pipeline.Workspace)/published-packages'
128
+
129
+ # Take the API Key from the OGX Torus subscription KV storage and use it to publish to Noget.org
106
130
steps :
107
131
- task : AzureKeyVault@2
108
132
inputs :
109
133
azureSubscription : ESRP-JSHost3
110
134
KeyVaultName : OGX-JSHost-KV
111
135
SecretsFilter : ' OGX-JSHost-Nuget-org-API-key-Microsoft-JavaScript-NodeApi'
112
136
RunAsPreJob : true
137
+
113
138
- task : NuGetToolInstaller@1
114
139
displayName : ' Use NuGet'
140
+
115
141
- script : ' nuget.exe SetApiKey $(OGX-JSHost-Nuget-org-API-key-Microsoft-JavaScript-NodeApi)'
116
142
displayName : ' NuGet SetApiKey (nuget.org)'
143
+
117
144
- script : dir /S $(Pipeline.Workspace)\published-packages
118
145
displayName : Show directory contents
146
+
119
147
- script : >
120
148
nuget.exe push
121
149
$(Pipeline.Workspace)\published-packages\Microsoft.JavaScript.NodeApi.*.nupkg
@@ -124,3 +152,35 @@ extends:
124
152
-NonInteractive
125
153
-Verbosity Detailed
126
154
displayName: 'NuGet push (nuget.org)'
155
+
156
+ - stage : npmjs_com_npm_publish
157
+ displayName : npm npmjs.com feed
158
+ jobs :
159
+ - job : npmjs_com_npm_job
160
+ displayName : Publish to npmjs.com
161
+ templateContext :
162
+ inputs :
163
+ - input : pipelineArtifact
164
+ pipeline : microsoft_node-api-dotnet_ci
165
+ artifactName : ' published-packages'
166
+ targetPath : $(Pipeline.Workspace)\published-packages
167
+
168
+ # Use ESRP Release to securely publish to npmjs.com.
169
+ steps :
170
+ - script : dir /S $(Pipeline.Workspace)\published-packages
171
+ displayName : Show directory contents
172
+
173
+ - task : ' SFP.release-tasks.custom-build-release-task.EsrpRelease@9'
174
+ displayName : ' ESRP Release to npmjs.com'
175
+ inputs :
176
+ connectedservicename : ' ESRP-JSHost3'
177
+ usemanagedidentity : false
178
+ keyvaultname : ' OGX-JSHost-KV'
179
+ authcertname : ' OGX-JSHost-Auth4'
180
+ signcertname : ' OGX-JSHost-Sign3'
181
+ clientid : ' 0a35e01f-eadf-420a-a2bf-def002ba898d'
182
+ domaintenantid : ' cdc5aeea-15c5-4db6-b079-fcadd2505dc2'
183
+ contenttype : npm
184
+ folderlocation : $(Pipeline.Workspace)\published-packages
185
+
186
+
0 commit comments