131 lines
5.7 KiB
XML
131 lines
5.7 KiB
XML
<Project>
|
|
|
|
<PropertyGroup>
|
|
<PublishDependsOn>
|
|
GetFilesToPublish;
|
|
PublishToAzureFeed;
|
|
PublishToMyGet;
|
|
</PublishDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="Publish" DependsOnTargets="$(PublishDependsOn)" />
|
|
|
|
<Target Name="GetFilesToPublish">
|
|
<ItemGroup>
|
|
<!-- Installer output files with specific metadata. -->
|
|
<_FilesToPublish Include="$(InstallersOutputPath)*.txt">
|
|
<ContentType>text/plain</ContentType>
|
|
</_FilesToPublish>
|
|
|
|
<_FilesToPublish Include="$(InstallersOutputPath)*.version">
|
|
<ContentType>text/plain</ContentType>
|
|
<CacheControl>no-cache, no-store, must-revalidate</CacheControl>
|
|
</_FilesToPublish>
|
|
|
|
<_FilesToPublish Include="$(InstallersOutputPath)*.svg">
|
|
<CacheControl>no-cache, no-store, must-revalidate</CacheControl>
|
|
<ContentType>image/svg+xml</ContentType>
|
|
</_FilesToPublish>
|
|
|
|
<!-- All other installer files. -->
|
|
<_FilesToPublish Include="$(InstallersOutputPath)*" Exclude="@(_FilesToPublish)" />
|
|
|
|
<!-- Java packages -->
|
|
<_FilesToPublish Include="$(ProductPackageOutputPath)*.jar;$(ProductPackageOutputPath)*.pom">
|
|
<BlobBasePath>aspnetcore/jar/$(PackageVersion)/</BlobBasePath>
|
|
</_FilesToPublish>
|
|
|
|
<!--
|
|
Transform the intermediate item group into the final group.
|
|
You can't use globbing _and_ set metadata using FileName and Extension at the same time. MSBuild quirks are fun.
|
|
-->
|
|
<FilesToPublish Include="@(_FilesToPublish)">
|
|
<RelativeBlobPath Condition="'%(_FilesToPublish.BlobBasePath)' != ''">%(_FilesToPublish.BlobBasePath)%(_FilesToPublish.FileName)%(_FilesToPublish.Extension)</RelativeBlobPath>
|
|
<RelativeBlobPath Condition="'%(_FilesToPublish.BlobBasePath)' == ''">aspnetcore/Runtime/$(PackageVersion)/%(_FilesToPublish.FileName)%(_FilesToPublish.Extension)</RelativeBlobPath>
|
|
</FilesToPublish>
|
|
<_FilesToPublish Remove="@(_FilesToPublish)" />
|
|
|
|
<!-- NPM packages -->
|
|
<NpmPackageToPublish Include="$(ProductPackageOutputPath)*.tgz" />
|
|
|
|
<PackageToPublish Include="$(ProductPackageOutputPath)*.symbols.nupkg" IsSymbolsPackage="true" />
|
|
<PackageToPublish Include="$(ProductPackageOutputPath)*.nupkg" Exclude="@(PackageToPublish)" />
|
|
</ItemGroup>
|
|
|
|
<!--
|
|
'Internal' packages are used to transfer bits to partner teams, and should not be used by customers.
|
|
Publishing these can be disabled.
|
|
-->
|
|
<ItemGroup Condition=" '$(PublishInternalPackages)' != 'false' ">
|
|
<PackageToPublish Include="$(InternalPackageOutputPath)*.symbols.nupkg" IsSymbolsPackage="true">
|
|
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
|
|
</PackageToPublish>
|
|
<PackageToPublish Include="$(InternalPackageOutputPath)*.nupkg" Exclude="@(PackageToPublish)">
|
|
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
|
|
</PackageToPublish>
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="PublishToMyGet"
|
|
DependsOnTargets="GetFilesToPublish;GetToolsets"
|
|
Condition="'$(PublishToMyget)' == 'true'">
|
|
|
|
<Error Text="Missing required property: PublishMyGetFeedUrl" Condition=" '$(PublishMyGetFeedUrl)' == '' "/>
|
|
<Error Text="Missing required property: PublishMyGetSymbolsFeedUrl" Condition=" '$(PublishMyGetSymbolsFeedUrl)' == '' "/>
|
|
<Error Text="Missing required property: PublishMyGetNpmRegistryUrl" Condition=" '$(PublishMyGetNpmRegistryUrl)' == '' "/>
|
|
<Error Text="Missing required property: PublishMyGetFeedKey" Condition=" '$(PublishMyGetFeedKey)' == '' "/>
|
|
|
|
<Error Text="No packages found to publish" Condition="@(PackageToPublish->Count()) == 0" />
|
|
|
|
<PushNuGetPackages Condition="'%(PackageToPublish.IsSymbolsPackage)' != 'true' AND @(PackageToPublish->Count()) != 0"
|
|
Packages="@(PackageToPublish)"
|
|
Feed="$(PublishMyGetFeedUrl)"
|
|
ApiKey="$(PublishMyGetFeedKey)" />
|
|
|
|
<PushNuGetPackages Condition="'%(PackageToPublish.IsSymbolsPackage)' == 'true' AND @(PackageToPublish->Count()) != 0"
|
|
Packages="@(PackageToPublish)"
|
|
Feed="$(PublishMyGetSymbolsFeedUrl)"
|
|
ApiKey="$(PublishMyGetFeedKey)" />
|
|
|
|
<PropertyGroup>
|
|
<AuthTokenSetting>$(PublishMyGetNpmRegistryUrl.Replace("https:", "")):_authToken</AuthTokenSetting>
|
|
</PropertyGroup>
|
|
|
|
<Message Condition=" @(NpmPackageToPublish->Count()) != 0 "
|
|
Text="Skipping NPM publish because there are no npm packages to publish."
|
|
Importance="high" />
|
|
|
|
<Exec Condition=" @(NpmPackageToPublish->Count()) != 0 "
|
|
Command="npm config set "$(AuthTokenSetting)" $(PublishMyGetFeedKey)"
|
|
StandardOutputImportance="Normal" />
|
|
|
|
<!-- When you UseCommandProcessor FileName is ignored -->
|
|
<Run Condition=" @(NpmPackageToPublish->Count()) != 0 "
|
|
FileName="cmd"
|
|
Arguments="npm;publish;--registry;$(PublishMyGetNpmRegistryUrl);%(NpmPackageToPublish.Identity)"
|
|
MaxRetries="5"
|
|
UseCommandProcessor="true"
|
|
ContinueOnError="true">
|
|
<Output TaskParameter="ExitCode" ItemName="_NpmExitCodes" />
|
|
</Run>
|
|
|
|
<Exec Condition=" @(NpmPackageToPublish->Count()) != 0 "
|
|
Command="npm config delete $(AuthTokenSetting)"
|
|
StandardOutputImportance="Normal" />
|
|
|
|
<Error Text="Publishing npm modules failed" Condition=" @(NpmPackageToPublish->Count()) != 0 AND %(_NpmExitCodes.Identity) != 0" />
|
|
</Target>
|
|
|
|
<Target Name="PublishToAzureFeed"
|
|
DependsOnTargets="GetFilesToPublish"
|
|
Condition="'$(PublishToAzureFeed)' == 'true'">
|
|
|
|
<RepoTasks.PublishToAzureBlob
|
|
AccountName="$(AzureAccountName)"
|
|
SharedAccessToken="$(AzureSharedAccessToken)"
|
|
ContainerName="$(AzureContainerName)"
|
|
Files="@(FilesToPublish)" />
|
|
</Target>
|
|
|
|
</Project>
|