Publishing.props 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <Project>
  2. <PropertyGroup>
  3. <PublishingVersion>3</PublishingVersion>
  4. </PropertyGroup>
  5. <PropertyGroup>
  6. <PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallersAndChecksumsAndProductVersion</PublishDependsOnTargets>
  7. <_UploadPathRoot>aspnetcore</_UploadPathRoot>
  8. <ProductVersionFileName>productVersion.txt</ProductVersionFileName>
  9. <RepoProductVersionFileName>$(_UploadPathRoot)-$(ProductVersionFileName)</RepoProductVersionFileName>
  10. <ProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(ProductVersionFileName)</ProductVersionFileLocation>
  11. <RepoProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(RepoProductVersionFileName)</RepoProductVersionFileLocation>
  12. </PropertyGroup>
  13. <!-- $(InstallersOutputPath), $(SymbolsOutputPath), and $(ChecksumExtensions) are not defined. Root Directory.Build.props is not imported. -->
  14. <ItemGroup>
  15. <!-- Include our "loose" PDBs when publishing symbols. -->
  16. <FilesToPublishToSymbolServer Include="$(ArtifactsDir)symbols\**\*.pdb" />
  17. <!-- Prepare for _PublishInstallersAndChecksums target. -->
  18. <_InstallersToPublish Remove="@(_InstallersToPublish)" />
  19. <_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.jar" UploadPathSegment="jar" />
  20. <_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.pom" UploadPathSegment="jar" />
  21. <_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.tgz" UploadPathSegment="npm" />
  22. <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.deb" UploadPathSegment="Runtime" />
  23. <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.exe" UploadPathSegment="Runtime" />
  24. <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.msi" UploadPathSegment="Runtime" />
  25. <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.rpm" UploadPathSegment="Runtime" />
  26. <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.tar.gz" UploadPathSegment="Runtime" />
  27. <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.version" UploadPathSegment="Runtime"
  28. Condition=" '$(PublishInstallerBaseVersion)' == 'true' " />
  29. <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.wixlib" UploadPathSegment="Runtime" />
  30. <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.zip" UploadPathSegment="Runtime" />
  31. <_ChecksumsToPublish Include="$(ArtifactsDir)installers\**\*.sha512" />
  32. </ItemGroup>
  33. <Target
  34. Name="_PublishInstallersAndChecksumsAndProductVersion"
  35. DependsOnTargets="_WriteProductVersionFile">
  36. <!--
  37. This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#,
  38. and npm project. We use SignalR.Npm.FunctionalTests.npmproj because it is non-shipping (we need a non-stable
  39. version string to use as our publish location), non-packed (won't be shipped in the future), and it is _not_ a
  40. C# or F# project. For now at least, C# and F# projects should not be referenced when using desktop msbuild.
  41. -->
  42. <MSBuild Projects="$(RepoRoot)src\SignalR\clients\ts\FunctionalTests\SignalR.Npm.FunctionalTests.npmproj"
  43. Properties="DisableYarnCheck=true;ExcludeFromBuild=false"
  44. Targets="_GetPackageVersionInfo">
  45. <Output TaskParameter="TargetOutputs" ItemName="_ResolvedPackageVersionInfo" />
  46. </MSBuild>
  47. <PropertyGroup>
  48. <_PackageVersion>@(_ResolvedPackageVersionInfo->'%(PackageVersion)')</_PackageVersion>
  49. </PropertyGroup>
  50. <ItemGroup>
  51. <!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows.
  52. Do not remove if post build sign is true, as we avoid the xplat codesign jobs, and need to have
  53. the nupkgs pushed. Do not do this if building from source, since we want the source build intermediate package
  54. to be published. Use ArcadeBuildFromSource as DotNetBuildFromSource is only set in the internal source build,
  55. and Build.proj is invoked from the wrapper build. -->
  56. <ItemsToPushToBlobFeed Remove="@(ItemsToPushToBlobFeed)" Condition="'$(OS)' != 'Windows_NT' and '$(PostBuildSign)' != 'true' and '$(ArcadeBuildFromSource)' != 'true'" />
  57. <ItemsToPushToBlobFeed Include="@(_ChecksumsToPublish)">
  58. <ManifestArtifactData>NonShipping=true</ManifestArtifactData>
  59. <PublishFlatContainer>true</PublishFlatContainer>
  60. <RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
  61. </ItemsToPushToBlobFeed>
  62. <ItemsToPushToBlobFeed Include="@(_InstallersToPublish)" Condition="! $([System.String]::Copy('%(Filename)').ToLower().Contains('internal'))">
  63. <ManifestArtifactData>NonShipping=false</ManifestArtifactData>
  64. <PublishFlatContainer>true</PublishFlatContainer>
  65. <RelativeBlobPath>$(_UploadPathRoot)/%(_InstallersToPublish.UploadPathSegment)/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
  66. </ItemsToPushToBlobFeed>
  67. <ItemsToPushToBlobFeed Include="@(_InstallersToPublish)" Condition="$([System.String]::Copy('%(Filename)').ToLower().Contains('internal'))">
  68. <ManifestArtifactData>NonShipping=true</ManifestArtifactData>
  69. <PublishFlatContainer>true</PublishFlatContainer>
  70. <RelativeBlobPath>$(_UploadPathRoot)/%(_InstallersToPublish.UploadPathSegment)/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
  71. </ItemsToPushToBlobFeed>
  72. <ItemsToPushToBlobFeed Include="$(ProductVersionFileLocation)" Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
  73. <ManifestArtifactData>NonShipping=true</ManifestArtifactData>
  74. <PublishFlatContainer>true</PublishFlatContainer>
  75. <RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(ProductVersionFileName)</RelativeBlobPath>
  76. </ItemsToPushToBlobFeed>
  77. <ItemsToPushToBlobFeed Include="$(RepoProductVersionFileLocation)" Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
  78. <ManifestArtifactData>NonShipping=true</ManifestArtifactData>
  79. <PublishFlatContainer>true</PublishFlatContainer>
  80. <RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(RepoProductVersionFileName)</RelativeBlobPath>
  81. </ItemsToPushToBlobFeed>
  82. </ItemGroup>
  83. </Target>
  84. <Target
  85. Name="_WriteProductVersionFile"
  86. Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
  87. <!--
  88. This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#,
  89. and npm project. We use Microsoft.JSInterop.JS.npmproj because it is shipping (we need a stable
  90. version string to use for productVersion.txt), and because it won't break when the SDK requires a newer
  91. desktop MSBuild than exists on the build machine.
  92. -->
  93. <MSBuild Projects="$(RepoRoot)src\JSInterop\Microsoft.JSInterop.JS\src\Microsoft.JSInterop.JS.npmproj"
  94. Properties="DisableYarnCheck=true;ExcludeFromBuild=false"
  95. Targets="_GetPackageVersionInfo">
  96. <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProductVersionInfo" />
  97. </MSBuild>
  98. <PropertyGroup>
  99. <_ProductVersion>@(_ResolvedProductVersionInfo->'%(PackageVersion)')</_ProductVersion>
  100. </PropertyGroup>
  101. <!-- Generate productVersion.txt containing the value of $(PackageVersion) -->
  102. <WriteLinesToFile
  103. File="$(ProductVersionFileLocation)"
  104. Lines="$(_ProductVersion)"
  105. Overwrite="true"
  106. Encoding="ASCII" />
  107. <WriteLinesToFile
  108. File="$(RepoProductVersionFileLocation)"
  109. Lines="$(_ProductVersion)"
  110. Overwrite="true"
  111. Encoding="ASCII" />
  112. </Target>
  113. </Project>