Sign packages during the no publish type leg
authorMatt Mitchell <mmitche@microsoft.com>
Wed, 21 Nov 2018 17:39:31 +0000 (09:39 -0800)
committerMatt Mitchell <mmitche@microsoft.com>
Wed, 21 Nov 2018 21:42:16 +0000 (13:42 -0800)
Commit migrated from https://github.com/dotnet/core-setup/commit/b81337350a3edcf3d8a0ba8edf893ea429851723

src/installer/buildpipeline/Core-Setup-Publish.json
src/installer/publish/publish.proj

index 333b483..66378e0 100644 (file)
       "continueOnError": false,
       "alwaysRun": false,
       "displayName": "Publish via PublishType",
-      "condition": "and(succeeded(), ne(variables.PB_PublishType, ''))",
+      "condition": "and(succeeded(), ne(variables.PB_PublishType, ''), ne(variables.PB_PublishType, 'nopublishtype'))",
       "timeoutInMinutes": 0,
       "task": {
         "id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
index de704f4..461b044 100644 (file)
   <Target Name="PublishFinalOutput"
           Condition="'$(Finalize)' == 'true'"
           DependsOnTargets="PublishCoreHostPackages;SetupPublishSymbols;PublishSymbols;FinalizeBuildInAzure;UpdateVersionsRepo" />
+    
+  <Target Name="GetPackagesToSign" DependsOnTargets="GatherShippingPackages">
+    <ItemGroup>
+      <FilesToSign Include="@(ShippedNugetPackage)">
+        <Authenticode>NuGet</Authenticode>
+      </FilesToSign>
+    </ItemGroup>
+    <Message Importance="High" Text="Attempting to sign package '%(FilesToSign.Identity)'" />
+  </Target>
+  
+  <Target Name="SignPackages"
+          Condition="'$(SkipSigning)' != 'true' and '$(SignType)' != 'public'"
+          DependsOnTargets="GetPackagesToSign;SignFiles">
+  </Target>
 
   <!--
     Target wrapping UpdatePublishedVersions: ensures that ShippedNuGetPackage items are created and
   -->
   <Target Name="UpdateVersionsRepo"
           Condition="'$(GitHubAuthToken)' != ''"
-          DependsOnTargets="ExcludeSymbolsPackagesFromPublishedVersions;
+          DependsOnTargets="GatherShippingPackages;
                             UpdatePublishedVersions" />
 
-  <Target Name="ExcludeSymbolsPackagesFromPublishedVersions">
+  <Target Name="GatherShippingPackages">
     <ItemGroup>
       <PackagesToShip Include="$(DownloadDirectory)*.nupkg" Exclude="$(DownloadDirectory)*.symbols.nupkg" />
       <PackagesToShip Remove="%(PackagesToShip.Identity)" Condition="$([System.String]::Copy('%(PackagesToShip.Identity)').Contains('latest'))" />
   </Target>
 
   <Target Name="PublishCoreHostPackages"
-          DependsOnTargets="CheckIfAllBuildsHavePublished;DownloadCoreHostPackages;DoPushCoreHostPackagesToFeed;DoPushCoreHostPackagesToAzure"
+          DependsOnTargets="CheckIfAllBuildsHavePublished;DownloadCoreHostPackages;SignPackages;DoPushCoreHostPackagesToFeed;DoPushCoreHostPackagesToAzure"
           Condition="'@(_MissingBlobNames)' == '' AND '$(NuGetFeedUrl)' != ''">
     <Error Condition="'$(NuGetFeedUrl)' ==''" Text="Missing required property NuGetFeedUrl" />
     <Error Condition="'$(NuGetApiKey)' == ''" Text="Missing required property NuGetApiKey" />
     </ItemGroup>
     <PropertyGroup>
       <DownloadDirectory Condition="'$(DownloadDirectory)' == ''">$(BinDir)PackageDownload/</DownloadDirectory>
+      <!-- The SignFiles target needs OutDir to be defined -->
+      <OutDir>$(DownloadDirectory)</OutDir>
     </PropertyGroup>
     <MakeDir Directories="$(DownloadDirectory)"
              Condition="!Exists('$(DownloadDirectory)')" />