Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 79 additions & 112 deletions .ado/publish.yml

Large diffs are not rendered by default.

63 changes: 60 additions & 3 deletions .ado/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ extends:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-latest
os: windows
customBuildTags:
- ES365AIMigrationTooling-Release
stages:
- stage: Release
displayName: Publish artifacts
Expand Down Expand Up @@ -73,7 +71,7 @@ extends:
Write-Host "Found $tgzCount .tgz files"
Write-Host "##vso[task.setvariable variable=HasPackagesToPublish]$($tgzCount -gt 0)"
displayName: Check if there are packages to publish
- task: 'SFP.release-tasks.custom-build-release-task.EsrpRelease@10'
- task: 'EsrpRelease@11'
displayName: 'ESRP Release to npmjs.com'
condition: and(succeeded(), ne(variables['NpmDistTag'], ''), eq(variables['HasPackagesToPublish'], 'true'))
inputs:
Expand Down Expand Up @@ -158,3 +156,62 @@ extends:
- script: nuget.exe push .\Microsoft.ReactNative.*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbol -NonInteractive -Verbosity Detailed
displayName: NuGet push (nuget.org)
workingDirectory: $(Pipeline.Workspace)/ReactWindows-final-nuget

- job: PublishSymbols
displayName: Publish PDB Symbols to Symbol Server
timeoutInMinutes: 30
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
pipeline: 'Publish'
artifactName: 'ReactWindows-final-nuget'
targetPath: '$(Pipeline.Workspace)/ReactWindows-final-nuget'
steps:
- powershell: |
# Extract PDB files from all NuGet packages (.nupkg are ZIP archives)
$nugetDir = "$(Pipeline.Workspace)/ReactWindows-final-nuget"
$symbolsDir = "$(Pipeline.Workspace)/symbols"
New-Item -ItemType Directory -Path $symbolsDir -Force | Out-Null

$nupkgs = Get-ChildItem "$nugetDir/*.nupkg"
Write-Host "Found $($nupkgs.Count) NuGet packages"

foreach ($nupkg in $nupkgs) {
Write-Host "Extracting PDBs from: $($nupkg.Name)"
$extractDir = "$symbolsDir/$($nupkg.BaseName)"
# Rename to .zip for Expand-Archive compatibility
$zipPath = "$nugetDir/$($nupkg.BaseName).zip"
Copy-Item $nupkg.FullName $zipPath
Expand-Archive -Path $zipPath -DestinationPath $extractDir -Force
Remove-Item $zipPath
}

# Show extracted PDBs
$pdbs = Get-ChildItem "$symbolsDir" -Recurse -Filter "*.pdb"
Write-Host "`nFound $($pdbs.Count) PDB files:"
foreach ($pdb in $pdbs) {
Write-Host " $($pdb.FullName) ($([math]::Round($pdb.Length / 1MB, 2)) MB)"
}

if ($pdbs.Count -eq 0) {
Write-Host "##vso[task.logissue type=warning]No PDB files found in NuGet packages"
}
displayName: Extract PDBs from NuGet packages

- task: PublishSymbols@2
displayName: 'Publish Symbols to Microsoft Symbol Server'
continueOnError: true
inputs:
UseNetCoreClientTool: true
ConnectedServiceName: Office-React-Native-Windows-Bot
SymbolsFolder: '$(Pipeline.Workspace)/symbols'
SearchPattern: '**/*.pdb'
SymbolServerType: 'TeamServices'
IndexSources: false # SourceLink is already embedded in PDBs at compile time
SymbolsProduct: 'ReactNativeWindows'
SymbolsVersion: '$(Build.BuildNumber)'
SymbolsArtifactName: 'ReactNativeWindows-Symbols-$(Build.BuildId)'
DetailedLog: true
TreatNotIndexedAsWarning: false
2 changes: 1 addition & 1 deletion .ado/templates/checkout-shallow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# without full history.
steps:
- checkout: self
fetchDepth: 10 # Buffer to avoid race condition with AZP jobs started against merge branch
fetchDepth: 1
clean: false
submodules: false
lfs: false
45 changes: 45 additions & 0 deletions .ado/templates/esrp-codesign-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
parameters:
- name: displayName
type: string
- name: folderPath
type: string
- name: pattern
type: string

steps:
- task: EsrpCodeSigning@6
displayName: ${{ parameters.displayName }}
inputs:
ConnectedServiceName: 'ESRP-CodeSigning-OGX-JSHost-RNW'
AppRegistrationClientId: '0a35e01f-eadf-420a-a2bf-def002ba898d'
AppRegistrationTenantId: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2'
AuthAKVName: 'OGX-JSHost-KV'
AuthCertName: 'OGX-JSHost-Auth4'
AuthSignCertName: 'OGX-JSHost-Sign3'
FolderPath: ${{ parameters.folderPath }}
Pattern: ${{ parameters.pattern }}
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode" : "CP-230012",
"OperationCode" : "SigntoolSign",
"Parameters" : {
"OpusName" : "Microsoft",
"OpusInfo" : "http://www.microsoft.com",
"FileDigest" : "/fd \"SHA256\"",
"PageHash" : "/PH",
"TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-230012",
"OperationCode" : "SigntoolVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
39 changes: 39 additions & 0 deletions .ado/templates/esrp-codesign-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
parameters:
- name: displayName
type: string
- name: folderPath
type: string
- name: pattern
type: string

steps:
- task: EsrpCodeSigning@6
displayName: ${{ parameters.displayName }}
inputs:
ConnectedServiceName: 'ESRP-CodeSigning-OGX-JSHost-RNW'
AppRegistrationClientId: '0a35e01f-eadf-420a-a2bf-def002ba898d'
AppRegistrationTenantId: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2'
AuthAKVName: 'OGX-JSHost-KV'
AuthCertName: 'OGX-JSHost-Auth4'
AuthSignCertName: 'OGX-JSHost-Sign3'
FolderPath: ${{ parameters.folderPath }}
Pattern: ${{ parameters.pattern }}
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode" : "CP-401405",
"OperationCode" : "NuGetSign",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-401405",
"OperationCode" : "NuGetVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
6 changes: 0 additions & 6 deletions .ado/templates/prep-and-pack-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ parameters:
type: boolean
default: false

- name: signMicrosoft
type: boolean
default: false

steps:
- pwsh: |
Expand Down Expand Up @@ -102,8 +99,6 @@ steps:
outputPackage: Microsoft.ReactNative
slices: $(releaseSlices)
packageVersion: ${{parameters.npmVersion}}
codesignBinaries: ${{ parameters.signMicrosoft }}
codesignNuget: ${{ parameters.signMicrosoft }}
buildProperties: CommitId=${{parameters.publishCommitId}};nugetroot=${{parameters.nugetroot}};baseconfiguration=Release;baseplatform=$(releaseBasePlatform)


Expand All @@ -113,7 +108,6 @@ steps:
outputPackage: Microsoft.ReactNative.Cxx
packageVersion: ${{parameters.npmVersion}}
buildProperties: CommitId=${{parameters.publishCommitId}};nugetroot=${{parameters.nugetroot}};baseconfiguration=$(baseConfiguration);baseplatform=$(basePlatform)
codesignNuget: ${{ parameters.signMicrosoft }}

- ${{ if eq(parameters.packMicrosoftReactNativeManaged, true) }}:
- ${{ if containsValue(parameters.slices.*.configuration, 'Release') }}:
Expand Down
99 changes: 4 additions & 95 deletions .ado/templates/prep-and-pack-single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parameters:
# Required: Name to publish the NuGet Package As
- name: outputPackage
type: string

# Required: NPM-matching version
- name: packageVersion
type: string
Expand All @@ -12,33 +12,17 @@ parameters:
type: string
default: ''

# Optional: Pattern of binaries within the artifact to sign as part of this
# NuGet package. Defaults to .dll, .winmd, .exe matching the nuspec name
- name: binariesToSign
type: string
default: ''

# Optional: Excludes platform-specific files from the NuSpec of they are not
# included in slices
- name: slices
type: string
default: ''

# Optional: Properties to pass to nuspec
# Optional: Properties to pass to nuspec
- name: buildProperties
type: string
default: ''

# Optional: Whether to sign binaries
- name: codesignBinaries
type: boolean
default: false

# Optional: Whether to sign the NuGet packag
- name: codesignNuget
type: boolean
default: false

steps:

- powershell: gci $(System.DefaultWorkingDirectory)/NugetRoot
Expand All @@ -54,50 +38,8 @@ steps:
displayName: '${{ parameters.outputPackage }} - Strip slices from nuspec'
workingDirectory: $(System.DefaultWorkingDirectory)/NugetRoot

- ${{ if eq(parameters.codesignBinaries, true) }}:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
displayName: '${{ parameters.outputPackage }} CodeSign Binaries'
inputs:
ConnectedServiceName: 'ESRP-CodeSigning-OGX-JSHost-RNW'
AppRegistrationClientId: '0a35e01f-eadf-420a-a2bf-def002ba898d'
AppRegistrationTenantId: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2'
AuthAKVName: 'OGX-JSHost-KV'
AuthCertName: 'OGX-JSHost-Auth4'
AuthSignCertName: 'OGX-JSHost-Sign3'
FolderPath: $(System.DefaultWorkingDirectory)/NugetRoot
# Recursively finds files matching these patterns:
${{ if ne(parameters.binariesToSign, '') }}:
Pattern: ${{ parameters.binariesToSign }}
${{ else }}:
Pattern: |
**/${{ coalesce(parameters.nuspec, parameters.outputPackage) }}.dll
**/${{ coalesce(parameters.nuspec, parameters.outputPackage) }}.winmd
**/${{ coalesce(parameters.nuspec, parameters.outputPackage) }}.exe
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode" : "CP-230012",
"OperationCode" : "SigntoolSign",
"Parameters" : {
"OpusName" : "Microsoft",
"OpusInfo" : "http://www.microsoft.com",
"FileDigest" : "/fd \"SHA256\"",
"PageHash" : "/PH",
"TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-230012",
"OperationCode" : "SigntoolVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
# Binary signing is done in build jobs (ESRP CodeSign before artifact upload)
# NuGet signing is done in batch in publish.yml (single ESRP call for all .nupkg)

# NuGetCommand@2 workaround: https://developercommunity.visualstudio.com/content/problem/288534/vsts-yaml-build-failure-the-task-name-nugetcommand.html
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
Expand All @@ -109,39 +51,6 @@ steps:
packDestination: $(System.DefaultWorkingDirectory)/NugetRootFinal
buildProperties: version=${{ parameters.packageVersion }};id=${{ parameters.outputPackage }};${{ parameters.buildProperties }}

- ${{ if eq(parameters.codesignNuget, true) }}:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
displayName: '${{ parameters.outputPackage }} CodeSign NuGet'
inputs:
ConnectedServiceName: 'ESRP-CodeSigning-OGX-JSHost-RNW'
AppRegistrationClientId: '0a35e01f-eadf-420a-a2bf-def002ba898d'
AppRegistrationTenantId: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2'
AuthAKVName: 'OGX-JSHost-KV'
AuthCertName: 'OGX-JSHost-Auth4'
AuthSignCertName: 'OGX-JSHost-Sign3'
FolderPath: $(System.DefaultWorkingDirectory)/NugetRootFinal
Pattern: |
**/${{ parameters.outputPackage }}.${{ parameters.packageVersion }}.nupkg
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode" : "CP-401405",
"OperationCode" : "NuGetSign",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-401405",
"OperationCode" : "NuGetVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]

- powershell: gci $(System.DefaultWorkingDirectory)/NugetRootFinal
displayName: List files in NugetRootFinal

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Speed up the publish pipeline",
"packageName": "react-native-windows",
"email": "vmorozov@microsoft.com",
"dependentChangeType": "patch"
}
13 changes: 13 additions & 0 deletions vnext/Microsoft.ReactNative.NewArch.Publish.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"solution": {
"path": "Microsoft.ReactNative.NewArch.sln",
"projects": [
"Common\\Common.vcxproj",
"Folly\\Folly.vcxproj",
"fmt\\fmt.vcxproj",
"Microsoft.ReactNative\\Microsoft.ReactNative.vcxproj",
"Microsoft.ReactNative.CsWinRT\\Microsoft.ReactNative.CsWinRT.csproj",
"ReactCommon\\ReactCommon.vcxproj"
]
}
}
29 changes: 29 additions & 0 deletions vnext/PropertySheets/CIBuildOptimizations.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
CI-specific C++ build optimizations for the publish pipeline.

This file is injected via /p:ForceImportAfterCppTargets in .ado/publish.yml.
It overrides defaults that are tuned for developer workflows (incremental builds,
file tracking) with settings that are better for CI clean builds.

1. Multi-threaded compilation: Use CL.exe internal /MP parallelism instead of
MSBuild's MultiToolTask (which spawns one CL.exe+Tracker.exe per source file).
/MP lets CL.exe compile all files in one process with shared PCH state.

2. Disable file tracking: CI always does clean builds, so incremental build
tracking (MinimalRebuild, TrackFileAccess) is pure overhead.
-->
<PropertyGroup>
<MultiProcCL>false</MultiProcCL>
<MinimalRebuildFromTracking>false</MinimalRebuildFromTracking>
<TrackFileAccess>false</TrackFileAccess>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalOptions>%(AdditionalOptions) /MP</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
</Project>
Loading
Loading