Skip to content

Commit 2e5a94a

Browse files
author
Harini Malothu
committed
Merge branch 'bumphermes2' of https://github.com/Microsoft/react-native-windows into bumphermes2
2 parents 570ae29 + 7e2ac21 commit 2e5a94a

18 files changed

Lines changed: 348 additions & 308 deletions

.ado/publish.yml

Lines changed: 79 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: 0.0.$(Date:yyMM.d)$(Rev:rrr)
22

33
parameters:
4-
- name: performBeachballCheck
5-
displayName: Perform Beachball Check (Disable when promoting)
6-
type: boolean
7-
default: true
84
- name: AgentPool
95
type: object
106
default:
@@ -49,23 +45,10 @@ parameters:
4945
- Name: Arm64ReleaseFabric
5046
BuildConfiguration: Release
5147
BuildPlatform: ARM64
52-
- Name: X64DebugFabric
53-
BuildConfiguration: Debug
54-
BuildPlatform: x64
55-
- Name: X86DebugFabric
56-
BuildConfiguration: Debug
57-
BuildPlatform: x86
58-
- Name: Arm64DebugFabric
59-
BuildConfiguration: Debug
60-
BuildPlatform: ARM64
6148

6249
variables:
6350
- template: variables/windows.yml
6451
- group: RNW Secrets
65-
- name: FailCGOnAlert
66-
value: false
67-
- name: EnableCodesign
68-
value: true
6952

7053
trigger: none
7154
pr: none
@@ -80,54 +63,50 @@ extends:
8063
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
8164
parameters:
8265
pool: ${{ parameters.AgentPool.Medium }}
83-
customBuildTags:
84-
- ES365AIMigrationTooling
66+
featureFlags:
67+
autoEnablePREfastWithNewRuleset: false # PREfast produces 0 actionable findings; auto-enable injects /analyze into every C++ TU, generating ~2656 SARIF files that Guardian uploads for ~19 min per native build
8568
sdl:
8669
credscan:
8770
suppressionsFile: $(Build.SourcesDirectory)\.ado\config\CredScanSuppressions.json
8871
spotBugs:
8972
enabled: false # We don't have any java, but random packages in node_modules do
73+
prefast:
74+
enabled: false
9075
stages:
9176
- stage: RNWPublish
9277
jobs:
93-
- job: RnwPublishPrep
94-
displayName: React-Native-Windows Publish Prep
78+
# Set version variables
79+
- job: SetVersionVars
80+
displayName: Set Version Variables
9581
pool: ${{ parameters.AgentPool.Medium }}
96-
timeoutInMinutes: 120
97-
cancelTimeoutInMinutes: 5
82+
timeoutInMinutes: 15
9883
steps:
99-
- template: .ado/templates/checkout-full.yml@self
84+
- template: .ado/templates/checkout-shallow.yml@self
85+
86+
- template: .ado/templates/set-version-vars.yml@self
10087
parameters:
101-
persistCredentials: false
88+
buildEnvironment: Continuous
10289

103-
- powershell: gci env:/BUILD_*
104-
displayName: Show build information
90+
# We new npmPack.js in Release pipeline to detect already published NPM packages and avoid publishing them again
91+
- script: copy ".ado\scripts\npmPack.js" "$(Build.StagingDirectory)\versionEnvVars\npmPack.js"
92+
displayName: Include npmPack.js in VersionEnvVars artifact
10593

106-
- template: .ado/templates/prepare-js-env.yml@self
94+
templateContext:
95+
outputs:
96+
- output: pipelineArtifact
97+
displayName: 'Publish version variables'
98+
targetPath: $(Build.StagingDirectory)/versionEnvVars
99+
artifactName: VersionEnvVars
107100

108-
- template: .ado/templates/run-compliance-prebuild.yml@self
109-
110-
- script: if not exist %USERPROFILE%\AppData\Roaming\npm (mkdir %USERPROFILE%\AppData\Roaming\npm)
111-
displayName: Fix missing npm config
112-
113-
- pwsh: |
114-
npx beachball check --verbose 2>&1 | Tee-Object -Variable beachballOutput
115-
$beachballErrors = $beachballOutput | Where-Object { $_ -match "ERROR: *"}
116-
$beachballErrors | ForEach { Write-Host "##vso[task.logissue type=error]$_" }
117-
if ( $beachballErrors.Count -gt 0) { throw "Beachball check found $($beachballErrors.Count) errors." }
118-
displayName: Beachball Check
119-
condition: ${{ parameters.performBeachballCheck }}
120-
121-
- job: RnwNpmPublish
122-
displayName: React-Native-Windows Npm Pack
123-
dependsOn: RnwPublishPrep
124-
pool:
125-
name: Azure-Pipelines-1ESPT-ExDShared
126-
image: windows-latest
127-
os: windows
128-
timeoutInMinutes: 120
101+
# Create NPM packages
102+
- job: RnwNpmPack
103+
displayName: Create NPM packages
104+
pool: ${{ parameters.AgentPool.Medium }}
105+
timeoutInMinutes: 60
129106
cancelTimeoutInMinutes: 5
130107
steps:
108+
- template: .ado/templates/checkout-shallow.yml@self
109+
131110
- template: .ado/templates/prepare-js-env.yml@self
132111
parameters:
133112
agentImage: HostedImage
@@ -138,45 +117,30 @@ extends:
138117
- script: dir /s "$(Pipeline.Workspace)\published-packages"
139118
displayName: Show created npm packages
140119

141-
- template: .ado/templates/set-version-vars.yml@self
142-
parameters:
143-
buildEnvironment: Continuous
144-
145-
- script: echo NpmDistTag is $(NpmDistTag)
146-
displayName: Show NPM dist tag
147-
148-
- script: copy ".ado\scripts\npmPack.js" "$(Build.StagingDirectory)\versionEnvVars\npmPack.js"
149-
displayName: Include npmPack.js in VersionEnvVars artifact
150-
151-
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
152-
displayName: 📒 Generate Manifest Npm
153-
inputs:
154-
BuildDropPath: $(System.DefaultWorkingDirectory)
155-
156120
templateContext:
157121
outputs:
158122
- output: pipelineArtifact
159123
displayName: 'Publish npm pack artifacts'
160124
condition: succeededOrFailed()
161125
targetPath: $(Pipeline.Workspace)/published-packages
162126
artifactName: NpmPackedTarballs
163-
- output: pipelineArtifact
164-
displayName: "📒 Publish Manifest Npm"
165-
artifactName: SBom-$(System.JobAttempt)
166-
targetPath: $(System.DefaultWorkingDirectory)/_manifest
167-
sbomEnabled: false # This output is in fact an SBOM itself
168-
- output: pipelineArtifact
169-
displayName: 'Publish version variables'
170-
targetPath: $(Build.StagingDirectory)/versionEnvVars
171-
artifactName: VersionEnvVars
172127

128+
# Run linting
129+
- template: .ado/jobs/linting.yml@self
130+
parameters:
131+
buildEnvironment: Continuous
132+
AgentPool: ${{ parameters.AgentPool }}
133+
134+
# Create and sign Destop DLLs
173135
- ${{ each matrix in parameters.desktopBuildMatrix }}:
174136
- job: RnwNativeBuildDesktop${{ matrix.Name }}
175137
displayName: Build Desktop ${{ matrix.Name }}
176-
dependsOn: RnwNpmPublish
138+
dependsOn: SetVersionVars
177139
pool: ${{ parameters.AgentPool.Large }}
178140
timeoutInMinutes: 360 # CodeQL requires 3x usual build timeout
179141
steps:
142+
- template: .ado/templates/checkout-shallow.yml@self
143+
180144
- template: .ado/templates/prepare-js-env.yml@self
181145

182146
- template: .ado/templates/prepare-build-env.yml@self
@@ -190,10 +154,11 @@ extends:
190154
- template: .ado/templates/msbuild-sln.yml@self
191155
parameters:
192156
solutionDir: vnext
193-
solutionName: ReactWindows-Desktop.sln
157+
solutionName: ReactWindows-Desktop.Publish.slnf
194158
buildPlatform: ${{ matrix.BuildPlatform }}
195159
buildConfiguration: ${{ matrix.BuildConfiguration }}
196160
oneESMode: true ## Files are only copied to staging, not published
161+
msbuildArguments: /p:ForceImportAfterCppTargets=$(Build.SourcesDirectory)\vnext\PropertySheets\CIBuildOptimizations.props
197162

198163
- template: .ado/templates/publish-build-artifacts.yml@self
199164
parameters:
@@ -202,14 +167,20 @@ extends:
202167
buildPlatform: ${{ matrix.BuildPlatform }}
203168
buildConfiguration: ${{ matrix.BuildConfiguration }}
204169
contents: |
205-
React.Windows.Desktop\**
206-
React.Windows.Desktop.DLL\**
207-
React.Windows.Desktop.Test.DLL\**
170+
React.Windows.Desktop\Microsoft.ReactNative.winmd
171+
React.Windows.Desktop.DLL\react-native-win32.*
208172
209-
- template: .ado/templates/component-governance.yml@self
173+
- template: .ado/templates/esrp-codesign-binaries.yml@self
174+
parameters:
175+
displayName: 'CodeSign Desktop Binaries'
176+
folderPath: $(Build.StagingDirectory)/NuGet/Desktop/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }}
177+
pattern: |
178+
**/react-native-win32.dll
210179
211180
templateContext:
212181
sdl:
182+
prefast:
183+
enabled: false
213184
binskim:
214185
analyzeTargetGlob: '$(Build.SourcesDirectory)\vnext\target\${{ matrix.BuildPlatform }}\${{ matrix.BuildConfiguration }}\React.Windows.Desktop.DLL\react-native-win32.dll'
215186
outputs:
@@ -228,13 +199,16 @@ extends:
228199
artifactName: Desktop.${{matrix.buildPlatform}}.${{matrix.buildConfiguration}}
229200
targetPath: $(Build.StagingDirectory)/NuGet/Desktop/${{matrix.buildPlatform}}/${{matrix.buildConfiguration}}
230201

202+
# Create and sign Universal DLLs
231203
- ${{ each matrix in parameters.universalBuildMatrix }}:
232204
- job: RnwNativeBuildUniversal${{ matrix.Name }}
233205
displayName: Build Universal ${{ matrix.Name }}
234-
dependsOn: RnwNpmPublish
206+
dependsOn: SetVersionVars
235207
pool: ${{ parameters.AgentPool.Large }}
236208
timeoutInMinutes: 360 # CodeQL requires 3x usual build timeout
237209
steps:
210+
- template: .ado/templates/checkout-shallow.yml@self
211+
238212
- template: .ado/templates/prepare-js-env.yml@self
239213

240214
- template: .ado/templates/prepare-build-env.yml@self
@@ -248,10 +222,11 @@ extends:
248222
- template: .ado/templates/msbuild-sln.yml@self
249223
parameters:
250224
solutionDir: vnext
251-
solutionName: Microsoft.ReactNative.NewArch.sln
225+
solutionName: Microsoft.ReactNative.NewArch.Publish.slnf
252226
buildPlatform: ${{ matrix.BuildPlatform }}
253227
buildConfiguration: ${{ matrix.BuildConfiguration }}
254228
oneESMode: true ## Files are only copied to staging, not published
229+
msbuildArguments: /p:ForceImportAfterCppTargets=$(Build.SourcesDirectory)\vnext\PropertySheets\CIBuildOptimizations.props
255230

256231
- task: PowerShell@2
257232
displayName: Make AnyCPU Reference Assemblies
@@ -266,13 +241,22 @@ extends:
266241
buildPlatform: ${{ matrix.BuildPlatform }}
267242
buildConfiguration: ${{ matrix.BuildConfiguration }}
268243
contents: |
269-
Microsoft.ReactNative\**
270-
Microsoft.ReactNative.CsWinRT\**
244+
Microsoft.ReactNative\Microsoft.ReactNative.*
245+
Microsoft.ReactNative.CsWinRT\Microsoft.ReactNative.Projection.*
271246
272-
- template: .ado/templates/component-governance.yml@self
247+
- template: .ado/templates/esrp-codesign-binaries.yml@self
248+
parameters:
249+
displayName: 'CodeSign Microsoft.ReactNative Binaries'
250+
folderPath: $(Build.StagingDirectory)/NuGet/ReactWindows/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }}
251+
pattern: |
252+
**/Microsoft.ReactNative.dll
253+
**/Microsoft.ReactNative.winmd
254+
**/Microsoft.ReactNative.Projection.dll
273255
274256
templateContext:
275257
sdl:
258+
prefast:
259+
enabled: false
276260
binskim:
277261
analyzeTargetGlob: '$(Build.SourcesDirectory)\vnext\target\${{ matrix.BuildPlatform }}\${{ matrix.BuildConfiguration }}\Microsoft.ReactNative\Microsoft.ReactNative.dll'
278262
outputs:
@@ -291,16 +275,18 @@ extends:
291275
artifactName: ReactWindows.${{ matrix.BuildPlatform }}.${{ matrix.BuildConfiguration }}
292276
targetPath: $(Build.StagingDirectory)/NuGet/ReactWindows/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }}
293277

278+
# Create Nuget packages
294279
- job: RNWNuget
280+
displayName: Pack NuGet
295281
dependsOn:
296-
- RnwNpmPublish
282+
- RnwNpmPack
283+
- Linting
297284
- ${{ each matrix in parameters.desktopBuildMatrix }}:
298285
- RnwNativeBuildDesktop${{ matrix.Name }}
299286
- ${{ each matrix in parameters.universalBuildMatrix }}:
300287
- RnwNativeBuildUniversal${{ matrix.Name }}
301-
displayName: Sign Binaries and Publish NuGet
302288
pool: ${{ parameters.AgentPool.Medium }}
303-
timeoutInMinutes: 120 # Protect against the long CodeSign task
289+
timeoutInMinutes: 60 # Protect against the long CodeSign task
304290

305291
steps:
306292
- template: .ado/templates/checkout-shallow.yml@self
@@ -309,7 +295,7 @@ extends:
309295

310296
- template: .ado/templates/apply-published-version-vars.yml@self
311297

312-
# The commit tag in the nuspec requires that we use at least nuget 5.8 (because things break with nuget versions before and Vs 16.8 or later)
298+
# The commit tag in the nuspec requires that we use at least nuget 5.8 (because things break with nuget versions before and VS 16.8 or later)
313299
- task: NuGetToolInstaller@1
314300
inputs:
315301
versionSpec: ">=5.8.0"
@@ -321,8 +307,6 @@ extends:
321307
npmVersion: $(npmVersion)
322308
packMicrosoftReactNative: true
323309
packMicrosoftReactNativeCxx: true
324-
${{ if or(eq(variables['EnableCodesign'], 'true'), endsWith(variables['Build.SourceBranchName'], '-stable')) }}: # Sign if EnableCodeSign or on *-stable release builds
325-
signMicrosoft: true
326310
slices:
327311
- platform: x64
328312
configuration: Release
@@ -337,8 +321,6 @@ extends:
337321
publishCommitId: $(publishCommitId)
338322
npmVersion: $(npmVersion)
339323
packDesktop: true
340-
${{ if or(eq(variables['EnableCodesign'], 'true'), endsWith(variables['Build.SourceBranchName'], '-stable')) }}: # Sign if EnableCodeSign or on *-stable release builds
341-
signMicrosoft: true
342324
slices:
343325
- platform: x64
344326
configuration: Release
@@ -353,24 +335,11 @@ extends:
353335
- platform: ARM64EC
354336
configuration: Debug
355337

356-
# Symbol Publishing for Work Item 59264834 - MSRC Compliance
357-
# continueOnError: Duplicate symbols are expected when the pipeline
358-
# is re-run for the same version. The symbols already exist on the
359-
# server, so it is safe to continue.
360-
- task: PublishSymbols@2
361-
displayName: 'Publish Symbols to Microsoft Symbol Server'
362-
continueOnError: true
363-
inputs:
364-
UseNetCoreClientTool: true
365-
ConnectedServiceName: Office-React-Native-Windows-Bot
366-
SymbolsFolder: '$(System.DefaultWorkingDirectory)\NugetRoot'
367-
SearchPattern: '**/*.pdb'
368-
SymbolServerType: 'TeamServices'
369-
SymbolsProduct: 'ReactNativeWindows'
370-
SymbolsVersion: '$(Build.BuildNumber)'
371-
SymbolsArtifactName: 'ReactNativeWindows-Symbols-$(Build.BuildId)'
372-
DetailedLog: true
373-
TreatNotIndexedAsWarning: false
338+
- template: .ado/templates/esrp-codesign-nuget.yml@self
339+
parameters:
340+
displayName: 'CodeSign all NuGet packages'
341+
folderPath: $(System.DefaultWorkingDirectory)/NugetRootFinal
342+
pattern: '**/*.nupkg'
374343

375344
templateContext:
376345
sdl:

0 commit comments

Comments
 (0)