diff --git a/eng/pipelines/build-all-lib.yml b/eng/pipelines/build-all-lib.yml index 7405ab6df3..d170d8c917 100644 --- a/eng/pipelines/build-all-lib.yml +++ b/eng/pipelines/build-all-lib.yml @@ -180,6 +180,14 @@ extends: projects: ${{ parameters.Projects }} arguments: '--configuration Release /p:ContinuousIntegrationBuild=true /p:DebugType=portable /p:DebugSymbols=true' + # Stage shipping binaries for symbol upload BEFORE the test step; + # see publish-symbols-stage.yml for why this must run pre-test. + # Pipeline only triggers on v* tags, but condition is explicit so + # a manual queue against a branch does not unintentionally upload. + - template: /eng/pipelines/publish-symbols-stage.yml@self + parameters: + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) + # Test and generate Code Coverage - task: DotNetCoreCLI@2 condition: eq(variables['ShouldTest'], 'true') @@ -215,6 +223,10 @@ extends: SearchPattern: '**/bin/**/*.pdb' # string. Required. Search pattern. Default: **/bin/**/*.pdb. SymbolServerType: 'TeamServices' + - template: /eng/pipelines/publish-symbols-upload.yml@self + parameters: + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) + # Since NuGet packages are generated during the build, we need to copy them to the artifacts folder. - task: CopyFiles@2 displayName: 'Pack $(Build.BuildNumber)' diff --git a/eng/pipelines/build-core-lib.yml b/eng/pipelines/build-core-lib.yml index d443896bc1..f56a7fe6b3 100644 --- a/eng/pipelines/build-core-lib.yml +++ b/eng/pipelines/build-core-lib.yml @@ -211,6 +211,12 @@ extends: #arguments: '--configuration Release /p:ContinuousIntegrationBuild=true -warnaserror' temp remove warnaserror arguments: '--configuration Release /p:ContinuousIntegrationBuild=true' + # Stage shipping binaries for symbol upload BEFORE the test step; + # see publish-symbols-stage.yml for why this must run pre-test. + - template: /eng/pipelines/publish-symbols-stage.yml@self + parameters: + condition: and(succeeded(), or(in(variables['Build.SourceBranch'], 'refs/heads/main', 'refs/heads/dev', 'refs/heads/dev-v5'), startsWith(variables['Build.SourceBranch'], 'refs/heads/archives/'))) + # Test and generate Code Coverage - task: DotNetCoreCLI@2 condition: eq(variables['ShouldTest'], 'true') @@ -239,6 +245,10 @@ extends: summaryFileLocation: '**/*.cobertura.xml' reportDirectory: CoverageFolder + - template: /eng/pipelines/publish-symbols-upload.yml@self + parameters: + condition: and(succeeded(), or(in(variables['Build.SourceBranch'], 'refs/heads/main', 'refs/heads/dev', 'refs/heads/dev-v5'), startsWith(variables['Build.SourceBranch'], 'refs/heads/archives/'))) + # Index sources and publish symbols - task: PublishSymbols@2 displayName: 'Publish Symbols to Artifact Services' diff --git a/eng/pipelines/publish-symbols-stage.yml b/eng/pipelines/publish-symbols-stage.yml new file mode 100644 index 0000000000..16400d2c86 --- /dev/null +++ b/eng/pipelines/publish-symbols-stage.yml @@ -0,0 +1,30 @@ +# Stage shipping binaries for symbol upload. Place this immediately after +# the Build step, BEFORE any task that runs `dotnet test` with a different +# /p:DebugType. The test step passes /p:DebugType=Full as a global MSBuild +# property, which propagates through P2P refs and rebuilds Core with a +# different MVID; if we staged after the test step, the binaries we upload +# would not match the binaries inside the shipping nupkg. +# +# The .pdb pattern is included for pipelines that build with +# /p:DebugType=portable (standalone PDBs). For pipelines using the csproj +# default of embedded, the PDB rides inside the DLL +# and the .pdb pattern matches nothing — harmless. We deliberately stay on +# SymWeb only (see publish-symbols-upload.yml's SubmitToInternet:false), +# so embedded-in-DLL is fine here. +parameters: +- name: condition + type: string + +steps: +- task: CopyFiles@2 + displayName: 'Collect shipping binaries for symbol upload' + condition: ${{ parameters.condition }} + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: | + src/**/bin/Release/**/Microsoft.FluentUI.*.dll + src/**/bin/Release/**/Microsoft.FluentUI.*.pdb + !src/Templates/** + TargetFolder: '$(Build.ArtifactStagingDirectory)/Symbols' + CleanTargetFolder: true + flattenFolders: false diff --git a/eng/pipelines/publish-symbols-upload.yml b/eng/pipelines/publish-symbols-upload.yml new file mode 100644 index 0000000000..b14f293e6e --- /dev/null +++ b/eng/pipelines/publish-symbols-upload.yml @@ -0,0 +1,27 @@ +# Upload the staged DLL (+ PDB, if standalone) pairs to the internal +# symbol server. SubmitToInternet:false keeps these out of the public +# symbol server (MSDL); the task will print a warning about that override +# which is intentional and safe to ignore. The counterpart to this template +# is publish-symbols-stage.yml, which must run earlier in the same job. +parameters: +- name: condition + type: string + +steps: +- task: MicroBuildArchiveSymbols@6 + displayName: 'Archive symbols to internal symbol server' + condition: ${{ parameters.condition }} + inputs: + azureSubscription: 'VSEng-SymbolsUpload' + SymbolsFeatureName: 'FluentUIBlazor' + SymbolsProject: 'DDE' + SymbolsAgentPath: '$(Build.ArtifactStagingDirectory)/Symbols' + # FluentUI is a public Blazor library; we publish to SymWeb for + # internal debugging but intentionally skip MSDL because we do not + # currently publish symbols there for our packages. The task warns + # when SubmitToInternet is overridden — SuppressSymwebOnlyWarning + # acknowledges the override is deliberate. + SubmitToInternet: false + SuppressSymwebOnlyWarning: true + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken)