Skip to content

Commit 3bb9cda

Browse files
authored
Perform symbol publication using Microsoft.SymbolUploader.Build.Task (#10358)
- aspnet/AspNetCore-Internal#2126 - allow release pipeline to publish symbols on all builds: #10113 - add new project that publishes symbols to MSDL and SymWeb - release pipeline prepares then restores and builds the new project - expire symbols after 10 years (or so) nits: - add `$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE` to ci.yml
1 parent 2c70498 commit 3bb9cda

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

.azure/pipelines/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ pr:
1717
include:
1818
- '*'
1919

20+
variables:
21+
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
22+
value: true
23+
2024
jobs:
2125
- template: jobs/default-build.yml
2226
parameters:

eng/PublishSymbols.proj

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="RunPublishSymbols">
2+
<PropertyGroup>
3+
<!-- TFM doesn't matter. These settings are required to make NuGet happy so we can restore required MSBuild packages. -->
4+
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
6+
<ManifestsPath>artifacts\manifests\</ManifestsPath>
7+
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
8+
9+
<!-- Expire symbols after 10 years (or so) by default. -->
10+
<DotNetSymbolExpirationInDays Condition="'$(DotNetSymbolExpirationInDays)' == ''">3650</DotNetSymbolExpirationInDays>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="Microsoft.SymbolUploader.Build.Task" Version="$(MicrosoftSymbolUploaderBuildTaskPackageVersion)" />
15+
</ItemGroup>
16+
17+
<!--
18+
Initially copied from
19+
https://github.com/dotnet/core-setup/blob/19390ee14c2824c39db393aff75a95788ececebf/publish/publish.proj#L242-L286
20+
-->
21+
<Target Name="RunPublishSymbols">
22+
<ItemGroup>
23+
<SymbolServerConfig
24+
Include="MSDL (public symbols server)"
25+
Url="https://microsoftpublicsymbols.artifacts.visualstudio.com/DefaultCollection"
26+
Pat="$(MicrosoftSymbolServerPAT)" />
27+
28+
<SymbolServerConfig
29+
Include="SymWeb (internal symbols server)"
30+
Url="https://microsoft.artifacts.visualstudio.com/DefaultCollection"
31+
Pat="$(SymwebSymbolServerPAT)" />
32+
</ItemGroup>
33+
34+
<Error
35+
Condition="'%(SymbolServerConfig.Pat)' == ''"
36+
Text="Missing symbol server publish PAT for '%(SymbolServerConfig.Identity)'" />
37+
38+
<!-- Could also set SymbolDryRun, SymbolExpirationInDays or SymbolVerboseLogging. -->
39+
<ItemGroup>
40+
<SymbolServerPublishProject
41+
Include="$(MSBuildProjectFullPath)"
42+
AdditionalProperties="
43+
SymbolServerDescription=%(SymbolServerConfig.Identity);
44+
SymbolServerPath=%(SymbolServerConfig.Url);
45+
SymbolServerPAT=%(SymbolServerConfig.Pat)" />
46+
</ItemGroup>
47+
48+
<!-- Note: Can't run in parallel. Symbol publish opens the zips exclusively. -->
49+
<MSBuild
50+
Projects="@(SymbolServerPublishProject)"
51+
Targets="SetupPublishSymbols;PublishSymbols"
52+
Properties="SymbolDirectory=$(SymbolDirectory)" />
53+
</Target>
54+
55+
<Target Name="SetupPublishSymbols">
56+
<ItemGroup>
57+
<SymbolPackagesToPublish Include="$(SymbolDirectory)/**/*.symbols.nupkg" />
58+
</ItemGroup>
59+
60+
<Message Importance="High" Text="Publishing symbol packages to '$(SymbolServerDescription)':%0A @(SymbolPackagesToPublish, '%0A ')"/>
61+
</Target>
62+
</Project>

eng/Versions.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
<MicrosoftNETTestSdkPackageVersion>15.9.0</MicrosoftNETTestSdkPackageVersion>
141141
<MicrosoftSourceLinkGitHubPackageVersion>1.0.0-beta2-18618-05</MicrosoftSourceLinkGitHubPackageVersion>
142142
<MicrosoftSourceLinkVstsGitPackageVersion>1.0.0-beta2-18618-05</MicrosoftSourceLinkVstsGitPackageVersion>
143+
<MicrosoftSymbolUploaderBuildTaskPackageVersion>1.0.0-beta-64023-03</MicrosoftSymbolUploaderBuildTaskPackageVersion>
143144
<!-- Stable dotnet/corefx packages no longer updated for .NET Core 3 -->
144145
<SystemBuffersPackageVersion>4.5.0</SystemBuffersPackageVersion>
145146
<SystemCodeDomPackageVersion>4.4.0</SystemCodeDomPackageVersion>

0 commit comments

Comments
 (0)