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+
18trigger : none
29name : $(Date:yyyyMMdd).$(Rev:r)
10+
311resources :
412 pipelines :
5- - pipeline : ' _microsoftnode -api-dotnet '
13+ - pipeline : ' microsoft_node -api-dotnet_ci '
614 project : ' ISS'
7- source : ' microsoft.node-api-dotnet'
15+ source : ' microsoft.node-api-dotnet.ci '
816 trigger :
917 branches :
1018 include :
1119 - main
20+
1221 repositories :
1322 - repository : CustomPipelineTemplates
1423 type : git
1524 name : 1ESPipelineTemplates/OfficePipelineTemplates
1625 ref : refs/tags/release
26+
1727extends :
1828 template : v1/Office.Official.PipelineTemplate.yml@CustomPipelineTemplates
1929 parameters :
@@ -23,26 +33,34 @@ extends:
2333 os : windows
2434 customBuildTags :
2535 - 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+ '**/*.*'
2742
43+ stages :
2844 - stage : ms_react_native_nuget_publish
2945 displayName : Nuget ms/react-native feed
3046 jobs :
3147 - job : ms_react_native_nuget_job
3248 displayName : Publish Nuget to ms/react-native
33- condition : succeeded()
34- timeoutInMinutes : 0
3549 templateContext :
3650 inputs :
3751 - input : pipelineArtifact
38- pipeline : _microsoftnode -api-dotnet
52+ pipeline : microsoft_node -api-dotnet_ci
3953 artifactName : published-packages
4054 targetPath : $(Pipeline.Workspace)\published-packages
55+
56+ # Use 1ES.PublishNuGet task to securely publish NuGet packages to ms/react-native-public feed.
4157 steps :
4258 - script : dir /S $(Pipeline.Workspace)\published-packages
4359 displayName : Show directory contents
60+
4461 - script : dotnet nuget list source
4562 displayName : Show Nuget sources
63+
4664 - task : 1ES.PublishNuGet@1
4765 displayName : NuGet push
4866 inputs :
@@ -59,30 +77,36 @@ extends:
5977 jobs :
6078 - job : ms_react_native_npm_job
6179 displayName : Agent job
62- condition : succeeded()
63- timeoutInMinutes : 0
6480 templateContext :
6581 inputs :
6682 - input : pipelineArtifact
67- pipeline : ' _microsoftnode -api-dotnet '
83+ pipeline : microsoft_node -api-dotnet_ci
6884 artifactName : ' published-packages'
6985 targetPath : $(Pipeline.Workspace)\published-packages
86+
87+ # Use the NPM utility to authenticate and publish to ADO ms/react-native feed
7088 steps :
7189 - task : NodeTool@0
72- displayName : Use Node 20 .x
90+ displayName : Use Node 22 .x
7391 inputs :
74- versionSpec : 20.x
92+ versionSpec : 22.x
93+
7594 - task : CmdLine@2
7695 displayName : Setup npmrc file for react-native feed
7796 inputs :
7897 script : |
7998 echo registry=https://pkgs.dev.azure.com/ms/_packaging/react-native/npm/registry/ > $(Pipeline.Workspace)\published-packages\.npmrc
8099 echo always-auth=true >> $(Pipeline.Workspace)\published-packages\.npmrc
100+
81101 - task : npmAuthenticate@0
82102 displayName : npm Authenticate .npmrc
83103 inputs :
84104 workingFile : $(Pipeline.Workspace)\published-packages\.npmrc
85105 customEndpoint : Npm - ms/react-native
106+
107+ - script : dir /S $(Pipeline.Workspace)\published-packages
108+ displayName : Show directory contents
109+
86110 - task : CmdLine@2
87111 displayName : npm publish to react-native feed
88112 inputs :
@@ -95,27 +119,31 @@ extends:
95119 jobs :
96120 - job : nuget_org_job
97121 displayName : Publish Nuget to nuget.org
98- condition : succeeded()
99- timeoutInMinutes : 0
100122 templateContext :
101123 inputs :
102124 - input : pipelineArtifact
103- pipeline : ' _microsoftnode -api-dotnet '
125+ pipeline : microsoft_node -api-dotnet_ci
104126 artifactName : ' published-packages'
105127 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
106130 steps :
107131 - task : AzureKeyVault@2
108132 inputs :
109133 azureSubscription : ESRP-JSHost3
110134 KeyVaultName : OGX-JSHost-KV
111135 SecretsFilter : ' OGX-JSHost-Nuget-org-API-key-Microsoft-JavaScript-NodeApi'
112136 RunAsPreJob : true
137+
113138 - task : NuGetToolInstaller@1
114139 displayName : ' Use NuGet'
140+
115141 - script : ' nuget.exe SetApiKey $(OGX-JSHost-Nuget-org-API-key-Microsoft-JavaScript-NodeApi)'
116142 displayName : ' NuGet SetApiKey (nuget.org)'
143+
117144 - script : dir /S $(Pipeline.Workspace)\published-packages
118145 displayName : Show directory contents
146+
119147 - script : >
120148 nuget.exe push
121149 $(Pipeline.Workspace)\published-packages\Microsoft.JavaScript.NodeApi.*.nupkg
@@ -124,3 +152,35 @@ extends:
124152 -NonInteractive
125153 -Verbosity Detailed
126154 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+ owners : ' vmorozov@microsoft.com'
186+ approvers : ' khosany@microsoft.com'
0 commit comments