Skip to content

Commit 7b3f242

Browse files
Merge branch 'main' into circulardependencyCheck
2 parents 1a7444d + 141b889 commit 7b3f242

70 files changed

Lines changed: 5000 additions & 279 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ado/jobs/desktop.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -325,17 +325,9 @@ jobs:
325325

326326
- template: ../templates/stop-packagers.yml
327327

328-
- task: BinSkim@4
329-
displayName: Run Binskim Analysis
328+
- script: node .ado/scripts/build.js --binskim --platform ${{ matrix.BuildPlatform }} --configuration ${{ matrix.BuildConfiguration }} --target desktop
329+
displayName: Run BinSkim Analysis
330330
condition: eq('${{ matrix.BuildConfiguration }}', 'Release')
331-
inputs:
332-
InputType: 'Basic'
333-
Function: 'analyze'
334-
TargetPattern: 'guardianGlob'
335-
AnalyzeTargetGlob: '$(Build.SourcesDirectory)\vnext\target\${{ matrix.BuildPlatform }}\${{ matrix.BuildConfiguration }}\React.Windows.Desktop.DLL\react-native-win32.dll'
336-
AnalyzeVerbose: true
337-
toolVersion: 'Latest'
338-
continueOnError: true
339331

340332
- template: ../templates/publish-build-artifacts.yml
341333
parameters:

.ado/jobs/universal.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,9 @@
177177
targetPath: $(Build.SourcesDirectory)/vnext/target/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }}
178178
artifactName: ReactWindows.${{ matrix.BuildPlatform }}.${{ matrix.BuildConfiguration }}
179179

180-
- task: BinSkim@4
181-
displayName: Run Binskim Analysis
180+
- script: node .ado/scripts/build.js --binskim --platform ${{ matrix.BuildPlatform }} --configuration ${{ matrix.BuildConfiguration }} --target universal
181+
displayName: Run BinSkim Analysis
182182
condition: and(succeeded(), eq('${{ matrix.BuildConfiguration }}', 'Release'), ne('${{ matrix.BuildPlatform }}', 'ARM64'))
183-
inputs:
184-
InputType: 'Basic'
185-
Function: 'analyze'
186-
TargetPattern: 'guardianGlob'
187-
AnalyzeTargetGlob: '$(Build.SourcesDirectory)\vnext\target\${{ matrix.BuildPlatform }}\${{ matrix.BuildConfiguration }}\Microsoft.ReactNative\Microsoft.ReactNative.dll'
188-
AnalyzeVerbose: true
189-
toolVersion: 'LatestPreRelease'
190183

191184
- template: ../templates/discover-google-test-adapter.yml
192185

.ado/publish.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ variables:
6565
- name: FailCGOnAlert
6666
value: false
6767
- name: EnableCodesign
68-
value: false
68+
value: true
6969

7070
trigger: none
7171
pr: none
@@ -145,6 +145,9 @@ extends:
145145
- script: echo NpmDistTag is $(NpmDistTag)
146146
displayName: Show NPM dist tag
147147

148+
- script: copy ".ado\scripts\npmPack.js" "$(Build.StagingDirectory)\versionEnvVars\npmPack.js"
149+
displayName: Include npmPack.js in VersionEnvVars artifact
150+
148151
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
149152
displayName: 📒 Generate Manifest Npm
150153
inputs:
@@ -351,9 +354,12 @@ extends:
351354
configuration: Debug
352355

353356
# 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.
354360
- task: PublishSymbols@2
355361
displayName: 'Publish Symbols to Microsoft Symbol Server'
356-
enabled: true
362+
continueOnError: true
357363
inputs:
358364
UseNetCoreClientTool: true
359365
ConnectedServiceName: Office-React-Native-Windows-Bot
@@ -362,7 +368,7 @@ extends:
362368
SymbolServerType: 'TeamServices'
363369
SymbolsProduct: 'ReactNativeWindows'
364370
SymbolsVersion: '$(Build.BuildNumber)'
365-
SymbolsArtifactName: 'ReactNativeWindows-Symbols'
371+
SymbolsArtifactName: 'ReactNativeWindows-Symbols-$(Build.BuildId)'
366372
DetailedLog: true
367373
TreatNotIndexedAsWarning: false
368374

.ado/release.yml

Lines changed: 48 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
#
2+
# The Release pipeline entry point.
3+
# It releases npm packages to npmjs.com and NuGet packages to the public
4+
# ms/react-native and ms/react-native-public ADO feeds and to nuget.org.
5+
#
6+
# The pipeline completion trigger is defined below in the pipeline resource.
7+
# Do NOT add a build completion trigger in the ADO UI — UI triggers override
8+
# YAML triggers and cause the pipeline to always run against the default branch
9+
# with incorrect metadata (wrong commit message and branch).
10+
#
11+
112
name: RNW NuGet Release $(Date:yyyyMMdd).$(Rev:r)
213

314
trigger: none
15+
pr: none
416

517
resources:
618
pipelines:
@@ -10,12 +22,16 @@ resources:
1022
trigger:
1123
branches:
1224
include:
13-
- -1espublish
25+
- main
26+
- refs/heads/main
27+
- '*-stable'
28+
- 'refs/heads/*-stable'
1429
repositories:
1530
- repository: 1ESPipelineTemplates
1631
type: git
1732
name: 1ESPipelineTemplates/1ESPipelineTemplates
1833
ref: refs/tags/release
34+
1935
extends:
2036
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
2137
parameters:
@@ -28,13 +44,18 @@ extends:
2844
stages:
2945
- stage: Release
3046
displayName: Publish artifacts
47+
# Allow manual runs unconditionally; for build-completion triggers,
48+
# only proceed if the commit message starts with 'RELEASE:'.
49+
condition: or(eq(variables['Build.Reason'], 'Manual'), startsWith(variables['Build.SourceVersionMessage'], 'RELEASE:'))
3150
jobs:
3251
- job: PushNpm
3352
displayName: npmjs.com - Publish npm packages
3453
variables:
3554
- group: RNW Secrets
36-
timeoutInMinutes: 0
55+
timeoutInMinutes: 30
3756
templateContext:
57+
type: releaseJob
58+
isProduction: true
3859
inputs:
3960
- input: pipelineArtifact
4061
pipeline: 'Publish'
@@ -45,15 +66,13 @@ extends:
4566
artifactName: 'VersionEnvVars'
4667
targetPath: '$(Pipeline.Workspace)/VersionEnvVars'
4768
steps:
48-
- checkout: self
49-
clean: false
5069
- task: CmdLine@2
5170
displayName: Apply version variables
5271
inputs:
5372
script: node $(Pipeline.Workspace)/VersionEnvVars/versionEnvVars.js
5473
- script: dir /s "$(Pipeline.Workspace)\published-packages"
5574
displayName: Show npm packages before cleanup
56-
- script: node .ado/scripts/npmPack.js --no-pack --check-npm --no-color "$(Pipeline.Workspace)\published-packages"
75+
- script: node "$(Pipeline.Workspace)\VersionEnvVars\npmPack.js" --no-pack --check-npm --no-color "$(Pipeline.Workspace)\published-packages"
5776
displayName: Remove already published packages
5877
- script: dir /s "$(Pipeline.Workspace)\published-packages"
5978
displayName: Show npm packages after cleanup
@@ -82,112 +101,69 @@ extends:
82101

83102
- job: PushPrivateAdo
84103
displayName: ADO - nuget - react-native
85-
104+
timeoutInMinutes: 30
86105
templateContext:
106+
type: releaseJob
107+
isProduction: true
87108
inputs:
88109
- input: pipelineArtifact
89110
pipeline: 'Publish'
90111
artifactName: 'ReactWindows-final-nuget'
91112
targetPath: '$(Pipeline.Workspace)/ReactWindows-final-nuget'
92-
93113
steps:
94-
- checkout: none
95-
96-
- script: dir /S $(Pipeline.Workspace)\ReactWindows-final-nuget
97-
displayName: Show directory contents
98-
99-
- task: AzureCLI@2
100-
displayName: Override NuGet credentials with Managed Identity
101-
inputs:
102-
azureSubscription: 'Office-React-Native-Windows-Bot'
103-
visibleAzLogin: false
104-
scriptType: 'pscore'
105-
scriptLocation: 'inlineScript'
106-
inlineScript: |
107-
$accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
108-
# Set the access token as a secret, so it doesn't get leaked in the logs
109-
Write-Host "##vso[task.setsecret]$accessToken"
110-
# Override the apitoken of the nuget service connection, for the duration of this stage
111-
Write-Host "##vso[task.setendpoint id=a7e33797-4804-4a1d-911d-5bd325e50a85;field=authParameter;key=apitoken]$accessToken"
112-
113-
- task: 1ES.PublishNuGet@1
114-
displayName: NuGet push to ms/react-native-public
115-
inputs:
116-
useDotNetTask: true
114+
- template: .ado/templates/publish-nuget-to-ado-feed.yml@self
115+
parameters:
116+
endpointId: 'a7e33797-4804-4a1d-911d-5bd325e50a85'
117+
nugetFeedUrl: 'https://pkgs.dev.azure.com/ms/_packaging/react-native/nuget/v3/index.json'
117118
packageParentPath: '$(Pipeline.Workspace)/ReactWindows-final-nuget'
118119
packagesToPush: '$(Pipeline.Workspace)/ReactWindows-final-nuget/*.nupkg'
119-
nuGetFeedType: external
120120
publishFeedCredentials: 'ms/react-native ADO Feed'
121-
externalEndpoint: 'ms/react-native ADO Feed'
122-
publishPackageMetadata: true
121+
feedDisplayName: 'ms/react-native'
123122

124123
- job: PushPublicAdo
125124
displayName: ADO - nuget - react-native-public
126-
125+
timeoutInMinutes: 30
127126
templateContext:
127+
type: releaseJob
128+
isProduction: true
128129
inputs:
129130
- input: pipelineArtifact
130131
pipeline: 'Publish'
131132
artifactName: 'ReactWindows-final-nuget'
132133
targetPath: '$(Pipeline.Workspace)/ReactWindows-final-nuget'
133-
134134
steps:
135-
- checkout: none
136-
137-
- script: dir /S $(Pipeline.Workspace)\ReactWindows-final-nuget
138-
displayName: Show directory contents
139-
140-
- task: AzureCLI@2
141-
displayName: Override NuGet credentials with Managed Identity
142-
inputs:
143-
azureSubscription: 'Office-React-Native-Windows-Bot'
144-
visibleAzLogin: false
145-
scriptType: 'pscore'
146-
scriptLocation: 'inlineScript'
147-
inlineScript: |
148-
$accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
149-
# Set the access token as a secret, so it doesn't get leaked in the logs
150-
Write-Host "##vso[task.setsecret]$accessToken"
151-
# Override the apitoken of the nuget service connection, for the duration of this stage
152-
Write-Host "##vso[task.setendpoint id=9a2456d0-c163-405b-be24-c03fd74b155a;field=authParameter;key=apitoken]$accessToken"
153-
154-
- task: 1ES.PublishNuGet@1
155-
displayName: NuGet push to ms/react-native-public
156-
inputs:
157-
useDotNetTask: true
135+
- template: .ado/templates/publish-nuget-to-ado-feed.yml@self
136+
parameters:
137+
endpointId: '9a2456d0-c163-405b-be24-c03fd74b155a'
138+
nugetFeedUrl: 'https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/nuget/v3/index.json'
158139
packageParentPath: '$(Pipeline.Workspace)/ReactWindows-final-nuget'
159140
packagesToPush: '$(Pipeline.Workspace)/ReactWindows-final-nuget/*.nupkg'
160-
nuGetFeedType: external
161141
publishFeedCredentials: 'ms/react-native-public ADO Feed'
162-
externalEndpoint: 'ms/react-native-public ADO Feed'
163-
publishPackageMetadata: true
142+
feedDisplayName: 'ms/react-native-public'
164143

165144
- job: PushNuGetOrg
166145
displayName: nuget.org - Push nuget packages
167146
variables:
168147
- group: RNW Secrets
169-
timeoutInMinutes: 0
148+
timeoutInMinutes: 30
170149
templateContext:
150+
type: releaseJob
151+
isProduction: true
171152
inputs:
172153
- input: pipelineArtifact
173154
pipeline: 'Publish'
174155
artifactName: 'ReactWindows-final-nuget'
175156
targetPath: '$(Pipeline.Workspace)/ReactWindows-final-nuget'
176157
steps:
177-
- checkout: none
178158
- task: NuGetToolInstaller@1
179-
displayName: 'Use NuGet '
159+
displayName: 'Use NuGet'
180160
- task: CmdLine@2
181161
displayName: NuGet SetApiKey (nuget.org)
182162
inputs:
183163
script: nuget.exe SetApiKey $(nugetorg-apiKey-push)
184164
workingDirectory: $(Pipeline.Workspace)/ReactWindows-final-nuget
185-
- task: PowerShell@2
165+
- script: dir /S "$(Pipeline.Workspace)\ReactWindows-final-nuget"
166+
displayName: Show directory contents
167+
- script: nuget.exe push .\Microsoft.ReactNative.*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbol -NonInteractive -Verbosity Detailed
186168
displayName: NuGet push (nuget.org)
187-
inputs:
188-
targetType: inline
189-
errorActionPreference: silentlyContinue
190-
script: |
191-
if (Get-ChildItem -Path .\ -Filter '*0.0.0-canary*' -ErrorAction SilentlyContinue) { Write-Output "Canary builds found, exiting."; return 0; }
192-
nuget.exe push .\Microsoft.ReactNative.*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbol -NonInteractive -Verbosity Detailed
193-
workingDirectory: $(Pipeline.Workspace)/ReactWindows-final-nuget
169+
workingDirectory: $(Pipeline.Workspace)/ReactWindows-final-nuget

0 commit comments

Comments
 (0)