11name : 0.0.$(Date:yyMM.d)$(Rev:rrr)
22
33parameters :
4- - name : skipNpmPublish
5- displayName : Skip Npm Publish
6- type : boolean
7- default : false
8- - name : skipGitPush
9- displayName : Skip Git Push
10- type : boolean
11- default : false
12- - name : stopOnNoCI
13- displayName : Stop if latest commit is ***NO_CI***
14- type : boolean
15- default : true
164- name : performBeachballCheck
175 displayName : Perform Beachball Check (Disable when promoting)
186 type : boolean
@@ -74,18 +62,10 @@ parameters:
7462variables :
7563 - template : variables/windows.yml
7664 - group : RNW Secrets
77- - name : SkipGitPushPublishArgs
78- value : ' '
7965 - name : FailCGOnAlert
8066 value : false
8167 - name : EnableCodesign
8268 value : false
83- - name : ArtifactServices.Symbol.AccountName
84- value : microsoft
85- - name : ArtifactServices.Symbol.PAT
86- value : $(pat-symbols-publish-microsoft)
87- - name : SourceBranchWithFolders
88- value : $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ]
8969
9070trigger : none
9171pr : none
@@ -105,8 +85,6 @@ extends:
10585 sdl :
10686 credscan :
10787 suppressionsFile : $(Build.SourcesDirectory)\.ado\config\CredScanSuppressions.json
108- binskim :
109- break : false # BA2007 is suppressed via .gdn/.gdnsuppress - don't fail build
11088 spotBugs :
11189 enabled : false # We don't have any java, but random packages in node_modules do
11290 stages :
@@ -118,20 +96,9 @@ extends:
11896 timeoutInMinutes : 120
11997 cancelTimeoutInMinutes : 5
12098 steps :
121- - powershell : |
122- Write-Host "Stopping because commit message contains ***NO_CI***."
123- $uri = "https://dev.azure.com/microsoft/ReactNative/_apis/build/builds/$(Build.BuildId)?api-version=5.1"
124- $json = @{status="Cancelling"} | ConvertTo-Json -Compress
125- $build = Invoke-RestMethod -Uri $uri -Method Patch -Headers @{Authorization = "Bearer $(System.AccessToken)"} -ContentType "application/json" -Body $json
126- Write-Host $build
127- Write-Host "Waiting 60 seconds for build cancellation..."
128- Start-Sleep -Seconds 60
129- displayName: Stop pipeline if latest commit message contains ***NO_CI***
130- condition: and(${{ parameters.stopOnNoCI }}, contains(variables['Build.SourceVersionMessage'], '***NO_CI***'))
131-
13299 - template : .ado/templates/checkout-full.yml@self
133100 parameters :
134- persistCredentials : false # We're going to use rnbot's git creds to publish
101+ persistCredentials : false
135102
136103 - powershell : gci env:/BUILD_*
137104 displayName : Show build information
@@ -144,15 +111,15 @@ extends:
144111 displayName : Fix missing npm config
145112
146113 - pwsh : |
147- npx --yes beachball check --verbose 2>&1 | Tee-Object -Variable beachballOutput
114+ npx beachball check --verbose 2>&1 | Tee-Object -Variable beachballOutput
148115 $beachballErrors = $beachballOutput | Where-Object { $_ -match "ERROR: *"}
149116 $beachballErrors | ForEach { Write-Host "##vso[task.logissue type=error]$_" }
150117 if ( $beachballErrors.Count -gt 0) { throw "Beachball check found $($beachballErrors.Count) errors." }
151118 displayName: Beachball Check
152119 condition: ${{ parameters.performBeachballCheck }}
153120
154121 - job : RnwNpmPublish
155- displayName : React-Native-Windows Npm Build Rev Publish
122+ displayName : React-Native-Windows Npm Pack
156123 dependsOn : RnwPublishPrep
157124 pool :
158125 name : Azure-Pipelines-1ESPT-ExDShared
@@ -165,65 +132,19 @@ extends:
165132 parameters :
166133 agentImage : HostedImage
167134
168- - template : .ado/templates/configure-git.yml@self
169-
170- - pwsh : |
171- Write-Host "##vso[task.setvariable variable=SkipGitPushPublishArgs]--no-push"
172- displayName: Enable No-Publish (git)
173- condition: ${{ parameters.skipGitPush }}
174-
175- # Beachball publishes NPM packages to the "$(Pipeline.Workspace)\published-packages" folder.
176- # It pushes NPM version updates to Git depending on the SkipGitPushPublishArgs variable derived from the skipGitPush parameter.
177- - script : |
178- if exist "$(Pipeline.Workspace)\published-packages" rd /s /q "$(Pipeline.Workspace)\published-packages"
179- mkdir "$(Pipeline.Workspace)\published-packages"
180- npx --yes beachball publish --no-publish $(SkipGitPushPublishArgs) --pack-to-path "$(Pipeline.Workspace)\published-packages" --branch origin/$(SourceBranchWithFolders) -yes --bump-deps --verbose --access public --message "applying package updates ***NO_CI***"
181- displayName: Beachball Publish
135+ - script : node .ado/scripts/npmPack.js --clean --no-color "$(Pipeline.Workspace)\published-packages"
136+ displayName : Pack npm packages
182137
183138 - script : dir /s "$(Pipeline.Workspace)\published-packages"
184139 displayName : Show created npm packages
185140
186- # Beachball reverts to local state after publish, but we want the updates it added
187- - script : git pull origin $(SourceBranchWithFolders)
188- displayName : git pull
189-
190- - script : npx @rnw-scripts/create-github-releases --yes --authToken $(githubAuthToken)
191- displayName : Create GitHub Releases (New Canary Version)
192- condition : and(succeeded(), ${{ not(parameters.skipGitPush) }}, ${{ eq(variables['Build.SourceBranchName'], 'main') }} )
193-
194- - script : npx --yes @rnw-scripts/create-github-releases@latest --yes --authToken $(githubAuthToken)
195- displayName : Create GitHub Releases (New Stable Version)
196- condition : and(succeeded(), ${{ not(parameters.skipGitPush) }}, ${{ ne(variables['Build.SourceBranchName'], 'main') }} )
197-
198141 - template : .ado/templates/set-version-vars.yml@self
199142 parameters :
200143 buildEnvironment : Continuous
201144
202145 - script : echo NpmDistTag is $(NpmDistTag)
203146 displayName : Show NPM dist tag
204147
205- - script : dir /s "$(Pipeline.Workspace)\published-packages"
206- displayName : Show npm packages before ESRP release
207-
208- # TODO: Re-enable after fixing publishing issues
209- - task : ' SFP.release-tasks.custom-build-release-task.EsrpRelease@10'
210- displayName : ' ESRP Release to npmjs.com'
211- enabled : true
212- condition : and(succeeded(), ne(variables['NpmDistTag'], ''))
213- inputs :
214- connectedservicename : ' ESRP-CodeSigning-OGX-JSHost-RNW'
215- usemanagedidentity : false
216- keyvaultname : ' OGX-JSHost-KV'
217- authcertname : ' OGX-JSHost-Auth4'
218- signcertname : ' OGX-JSHost-Sign3'
219- clientid : ' 0a35e01f-eadf-420a-a2bf-def002ba898d'
220- domaintenantid : ' cdc5aeea-15c5-4db6-b079-fcadd2505dc2'
221- contenttype : npm
222- folderlocation : ' $(Pipeline.Workspace)\published-packages'
223- productstate : ' $(NpmDistTag)'
224- owners : ' vmorozov@microsoft.com'
225- approvers : ' khosany@microsoft.com'
226-
227148 - task : AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
228149 displayName : 📒 Generate Manifest Npm
229150 inputs :
@@ -347,15 +268,6 @@ extends:
347268
348269 - template : .ado/templates/component-governance.yml@self
349270
350- # Make symbols available through http://symweb.
351- - task : PublishSymbols@2
352- displayName : Publish symbols
353- enabled : false
354- inputs :
355- SearchPattern : vnext/target/**/*.pdb
356- SymbolServerType : TeamServices
357- Pat : $(System.AccessToken)
358-
359271 templateContext :
360272 sdl :
361273 binskim :
@@ -441,9 +353,10 @@ extends:
441353 # Symbol Publishing for Work Item 59264834 - MSRC Compliance
442354 - task : PublishSymbols@2
443355 displayName : ' Publish Symbols to Microsoft Symbol Server'
444- enabled : false
445- condition : and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
356+ enabled : true
446357 inputs :
358+ UseNetCoreClientTool : true
359+ ConnectedServiceName : Office-React-Native-Windows-Bot
447360 SymbolsFolder : ' $(System.DefaultWorkingDirectory)\NugetRoot'
448361 SearchPattern : ' **/*.pdb'
449362 SymbolServerType : ' TeamServices'
@@ -452,7 +365,6 @@ extends:
452365 SymbolsArtifactName : ' ReactNativeWindows-Symbols'
453366 DetailedLog : true
454367 TreatNotIndexedAsWarning : false
455- Pat : $(System.AccessToken)
456368
457369 templateContext :
458370 sdl :
0 commit comments