Use an alternate approach to publishing nupkgs only on Windows (#8426)

This avoids an issue where the source build intermediate, built on Linux, didn't have the nupkgs in it because they were only packaged on Windows. Instead of restrictig packaging to only Windows, only push nupkgs on Windows, or in source-build situations. This is a little simpler, and has the added advantage that a developer can work on Linux or Mac and produce the nupkgs for testing or dev work.
This commit is contained in:
Matt Mitchell 2023-03-14 17:40:08 -07:00 коммит произвёл GitHub
Родитель 9c788cd4ac
Коммит c12b6f32ca
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 11 добавлений и 7 удалений

Просмотреть файл

@ -2,17 +2,17 @@
<Project>
<PropertyGroup>
<PublishingVersion>3</PublishingVersion>
<PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishingBlobItems</PublishDependsOnTargets>
<PublishDependsOnTargets>$(PublishDependsOnTargets);_UpdatePublishItems</PublishDependsOnTargets>
<_UploadPathRoot>razor</_UploadPathRoot>
</PropertyGroup>
<ItemGroup>
<!-- Prepare for _PublishingBlobItems target. -->
<!-- Prepare for _UpdatePublishItems target. -->
<_ItemsToPublish Include="$(ArtifactsPackagesDir)**\*.tgz" Condition="'$(OS)' == 'Windows_NT'" />
<_ItemsToPublish Include="$(ArtifactsDir)LanguageServer\**\*.zip" />
</ItemGroup>
<Target Name="_PublishingBlobItems">
<Target Name="_UpdatePublishItems">
<!-- This target is defined in eng/targets/Packaging.targets and included in every project. -->
<MSBuild Projects="$(RepoRoot)src\Razor\src\Microsoft.AspNetCore.Razor.LanguageServer\Microsoft.AspNetCore.Razor.LanguageServer.csproj"
Targets="_GetPackageVersionInfo"
@ -25,6 +25,10 @@
</PropertyGroup>
<ItemGroup>
<!-- Packages can be built on all platforms, but are only published on Windows to avoid collisions from the other
platforms. This does not affect the SB intermediate package. -->
<ItemsToPushToBlobFeed Remove="$(ArtifactsDir)**\*.nupkg" Condition="'$(OS)' != 'Windows_NT' and '$(ArcadeBuildFromSource)' != 'true'" />
<ItemsToPushToBlobFeed Include="@(_ItemsToPublish)">
<IsShipping>false</IsShipping>
<ManifestArtifactData>ShipInstaller=dotnetcli;NonShipping=true</ManifestArtifactData>

Просмотреть файл

@ -7,7 +7,7 @@
<SuppressDependenciesWhenPacking>false</SuppressDependenciesWhenPacking>
<NoPackageAnalysis>true</NoPackageAnalysis>
<GenerateDependencyFile>false</GenerateDependencyFile>
<IsPackable Condition="'$(OS)' == 'Windows_NT'">true</IsPackable>
<IsPackable>true</IsPackable>
<!-- Need to build this project in source build -->
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup>

Просмотреть файл

@ -5,7 +5,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<IsShipping>false</IsShipping>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IsPackable Condition="'$(OS)' == 'Windows_NT'">true</IsPackable>
<IsPackable>true</IsPackable>
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup>

Просмотреть файл

@ -5,7 +5,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<IsShipping>false</IsShipping>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IsPackable Condition="'$(OS)' == 'Windows_NT'">true</IsPackable>
<IsPackable>true</IsPackable>
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup>

Просмотреть файл

@ -67,6 +67,6 @@
</ItemGroup>
<MSBuild Projects="@(ProjectToPublish)" Targets="Publish;_IncludeOmniSharpPlugin" BuildInParallel="false" />
<MSBuild Projects="@(ProjectToPublish_PlatformAgnostic)" Targets="Publish;_IncludeOmniSharpPlugin" BuildInParallel="false" Condition="'$(OS)' == 'Windows_NT'" />
<MSBuild Projects="@(ProjectToPublish_PlatformAgnostic)" Targets="Publish;_IncludeOmniSharpPlugin" BuildInParallel="false" />
</Target>
</Project>