Skip to content

Commit

Permalink
Remove prepare-artifacts.proj (#4251)
Browse files Browse the repository at this point in the history
* Remove prepare-artifacts.proj

... use common publishing infra

* Don't set OfficialBuildId in non-official builds

* Undo test condition

* Fix things

* Disable validate stage again

* Upgrade pool

* Simplify YML

* Fix yml

* Publish rid specific packages on other legs

* More clean-up

* Fix duplicate condition

* Add SetPackageToInclude target that depends on Arcade change

* Update Publishing.props
  • Loading branch information
ViktorHofer committed Mar 18, 2024
1 parent 570b297 commit bccc080
Show file tree
Hide file tree
Showing 15 changed files with 160 additions and 519 deletions.
12 changes: 3 additions & 9 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ variables:
# Skip Running CI tests
- name: SkipTests
value: false
# Set Official Build Id
- name: OfficialBuildId
value: $(Build.BuildNumber)
- ${{ if or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), eq(variables['Build.Reason'], 'Manual')) }}:
- name: PostBuildSign
value: false
- ${{ else }}:
- name: PostBuildSign
value: true

# Set the target blob feed for package publish during official and validation builds.
- name: _DotNetArtifactsCategory
Expand All @@ -48,16 +39,19 @@ stages:
- template: /eng/pipelines/jobs/windows-build-PR.yml
parameters:
name: win_x64
displayName: win-x64
targetArchitecture: x64

# Windows x86
- template: /eng/pipelines/jobs/windows-build-PR.yml
parameters:
name: win_x86
displayName: win-x86
targetArchitecture: x86

# Windows arm64
- template: /eng/pipelines/jobs/windows-build-PR.yml
parameters:
name: win_arm64
displayName: win-arm64
targetArchitecture: arm64
22 changes: 8 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ variables:
value: dotnet-core-acquisition
# Skip Running CI tests
- name: SkipTests
value: false
value: true
# Set Official Build Id
- name: OfficialBuildId
value: $(Build.BuildNumber)
Expand Down Expand Up @@ -60,50 +60,44 @@ extends:
- template: /eng/pipelines/jobs/windows-build.yml@self
parameters:
name: win_x64
displayName: win-x64
targetArchitecture: x64

# Windows x86
- template: /eng/pipelines/jobs/windows-build.yml@self
parameters:
name: win_x86
displayName: win-x86
targetArchitecture: x86

# Windows arm64
- template: /eng/pipelines/jobs/windows-build.yml@self
parameters:
name: win_arm64
displayName: win-arm64
targetArchitecture: arm64

- stage: PrepareForPublish
displayName: Prepare for Publish
dependsOn: Build
jobs:
# Prep artifacts: sign them and upload pipeline artifacts expected by stages-based publishing.
- template: /eng/pipelines/jobs/prepare-signed-artifacts.yml@self
parameters:
PublishRidAgnosticPackagesFromJobName: win_x64
# Publish to Build Asset Registry in order to generate the ReleaseConfigs artifact.
- template: /eng/common/templates-official/job/publish-build-assets.yml@self
parameters:
publishUsingPipelines: true
publishAssetsImmediately: true
dependsOn: PrepareSignedArtifacts
dependsOn:
- win_x64
- win_x86
- win_arm64
pool:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals windows.vs2022preview.amd64

# Stages-based publishing entry point
- template: /eng/common/templates-official/post-build/post-build.yml@self
parameters:
publishingInfraVersion: 3
validateDependsOn:
- PrepareForPublish
enableSymbolValidation: false
enableSigningValidation: false
enableNugetValidation: false
enableSourceLinkValidation: false
publishAssetsImmediately: true

SDLValidationParameters:
enable: false
params: >-
Expand Down
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build -bl %*"
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build %*"
19 changes: 19 additions & 0 deletions eng/AfterSigning.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project>

<PropertyGroup>
<_SuppressSdkImports>false</_SuppressSdkImports>
</PropertyGroup>

<ItemGroup>
<InstallerFile Include="$(ArtifactsShippingPackagesDir)**\*.msi;
$(ArtifactsShippingPackagesDir)**\*.exe;
$(ArtifactsShippingPackagesDir)**\*.zip"
Exclude="$(ArtifactsShippingPackagesDir)**\*.wixpack.zip" />

<GenerateChecksumItems Include="@(InstallerFile)"
DestinationPath="%(FullPath).sha512" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />

</Project>
67 changes: 60 additions & 7 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,44 @@

<PropertyGroup>
<ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
<!-- Don't push rid agnostic nuget packages from other builds than win-x64 when not building inside the VMR. -->
<EnableDefaultPublishItems Condition="'$(DotNetBuildRepo)' != 'true' and
'$(TargetArchitecture)' != 'x64' and
'$(TargetArchitecture)' != ''">false</EnableDefaultPublishItems>
<!-- This avoids creating VS.*.symbols.nupkg packages that are identical to the original package. -->
<AutoGenerateSymbolPackages>false</AutoGenerateSymbolPackages>
</PropertyGroup>

<!-- Include installer archives and packages which aren't globbed by default. -->
<Target Name="PublishWindowsDesktopInstallers"
<Target Name="SetPackageToInclude"
BeforeTargets="BeforePublish"
Condition="'$(DotNetBuildRepo)' == 'true'">
<!-- Retrieve windows desktop runtime pack product version.
Don't stabilize the package version in order to retrieve the VersionSuffix. -->
Condition="'$(EnableDefaultPublishItems)' != 'true'">
<ItemGroup>
<!-- Only include RID specific packages -->
<PackageToInclude Include="Microsoft.WindowsDesktop.App.Runtime" />
<PackageToInclude Include="VS.Redist.Common.WindowsDesktop" />

<ExistingSymbolPackages Include="$(ArtifactsShippingPackagesDir)**/%(PackageToInclude.Identity)*.symbols.nupkg" IsShipping="true" />
<ExistingSymbolPackages Include="$(ArtifactsNonShippingPackagesDir)**/%(PackageToInclude.Identity)*.symbols.nupkg" IsShipping="false" />

<PackagesToPublish Include="$(ArtifactsShippingPackagesDir)**/%(PackageToInclude.Identity)*.nupkg" IsShipping="true" />
<PackagesToPublish Include="$(ArtifactsNonShippingPackagesDir)**/%(PackageToInclude.Identity)*.nupkg" IsShipping="false" />
</ItemGroup>
</Target>

<!-- Retrieve the runtime pack product version.
Don't stabilize the package version in order to retrieve the VersionSuffix. -->
<Target Name="GetProductVersion">
<MSBuild Projects="$(RepoRoot)src/windowsdesktop/src/sfx/Microsoft.WindowsDesktop.App.Runtime.sfxproj"
Targets="ReturnProductVersion"
Properties="IsShipping=false">
<Output TaskParameter="TargetOutputs" PropertyName="WindowsDesktopRuntimePackProductVersion" />
<Output TaskParameter="TargetOutputs" PropertyName="RuntimePackProductVersion" />
</MSBuild>
</Target>

<!-- Include installer archives and packages which aren't globbed by default. -->
<Target Name="PublishInstallers"
DependsOnTargets="GetProductVersion"
BeforeTargets="PublishToAzureDevOpsArtifacts">
<ItemGroup>
<InstallerToPublish Include="$(ArtifactsPackagesDir)**\*.zip;
$(ArtifactsPackagesDir)**\*.exe;
Expand All @@ -24,7 +48,36 @@
<ItemsToPushToBlobFeed Include="@(InstallerToPublish)"
IsShipping="$([System.String]::Copy('%(RecursiveDir)').StartsWith('Shipping'))"
PublishFlatContainer="true"
RelativeBlobPath="WindowsDesktop/$(WindowsDesktopRuntimePackProductVersion)/%(Filename)%(Extension)" />
RelativeBlobPath="WindowsDesktop/$(RuntimePackProductVersion)/%(Filename)%(Extension)" />

<!-- Include checksums -->
<ChecksumToPublish Include="$(ArtifactsPackagesDir)**\*.sha512" />
<ItemsToPushToBlobFeed Include="@(ChecksumToPublish)"
IsShipping="false"
PublishFlatContainer="true"
RelativeBlobPath="WindowsDesktop/$(RuntimePackProductVersion)/%(Filename)%(Extension)" />
</ItemGroup>
</Target>

<Target Name="GenerateAndPublishProductVersionFiles"
DependsOnTargets="GetProductVersion"
BeforeTargets="PublishToAzureDevOpsArtifacts">
<ItemGroup>
<ProductVersionFile Include="$(ArtifactsShippingPackagesDir)productVersion.txt" />
<ProductVersionFile Include="$(ArtifactsShippingPackagesDir)windowsdesktop-productVersion.txt" />
</ItemGroup>

<!-- Generate productVersion.txt file containing the product version. -->
<WriteLinesToFile File="%(ProductVersionFile.Identity)"
Lines="$(RuntimePackProductVersion)"
Overwrite="true"
Encoding="ASCII" />

<ItemGroup>
<ItemsToPushToBlobFeed Include="@(ProductVersionFile)"
IsShipping="false"
PublishFlatContainer="true"
RelativeBlobPath="WindowsDesktop/$(RuntimePackProductVersion)/%(Filename)%(Extension)" />
</ItemGroup>
</Target>

Expand Down
29 changes: 0 additions & 29 deletions eng/Signing.props
Original file line number Diff line number Diff line change
@@ -1,40 +1,11 @@
<Project>

<PropertyGroup>
<!--
Windows arm/arm64 jobs don't have MSIs to sign. Keep it simple: allow not finding any matches
here and rely on overall signing validation.
-->
<AllowEmptySignList Condition="'$(SignFinalPackages)' != 'true'">true</AllowEmptySignList>
<UseDotNetCertificate>true</UseDotNetCertificate>
</PropertyGroup>

<ItemGroup>
<!--
Replace the default items to sign with the specific set we want.
-->
<ItemsToSign Remove="@(ItemsToSign)" />
<ItemsToSignPostBuild Remove="@(ItemsToSignPostBuild)" />

<!-- apphost and comhost template files are not signed, by design. -->
<FileSignInfo Include="apphost.exe;comhost.dll" CertificateName="None" />

<FileExtensionSignInfo Include=".msi" CertificateName="MicrosoftDotNet500" />
<FileExtensionSignInfo Include=".pkg" CertificateName="8003" />
<FileExtensionSignInfo Include=".deb;.rpm" CertificateName="LinuxSign" />
</ItemGroup>

<!-- This repo signs everything, including installers, either right before doing the PushToAzureDevOpsArtifacts,
or in post-build. Populate what will get signed the same in both cases -->
<ItemGroup Condition="'$(PrepareArtifacts)' == 'true'">
<ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.msi" />
<ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.exe" />
<ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.nupkg" />
<ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.zip" />

<ItemsToSignWithoutPaths Include="@(ItemsToSignWithPaths->'%(Filename)%(Extension)')" />
<ItemsToSignPostBuild Include="@(ItemsToSignWithoutPaths->Distinct())" Condition="'$(PostBuildSign)' == 'true'" />
<ItemsToSign Include="@(ItemsToSignWithPaths->Distinct())" Condition="'$(PostBuildSign)' != 'true'" />
</ItemGroup>

</Project>
2 changes: 0 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
</PropertyGroup>
<PropertyGroup>
<!-- arcade -->
<MicrosoftDotNetBuildTasksFeedVersion>9.0.0-beta.24168.1</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetBuildTasksArchivesVersion>9.0.0-beta.24168.1</MicrosoftDotNetBuildTasksArchivesVersion>
<MicrosoftDotNetBuildTasksInstallersVersion>9.0.0-beta.24168.1</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetVersionToolsTasksVersion>9.0.0-beta.24168.1</MicrosoftDotNetVersionToolsTasksVersion>
<!-- corefx -->
<SystemDataDataSetExtensionsVersion>4.5.0</SystemDataDataSetExtensionsVersion>
<SystemDataSqlClientVersion>4.8.6</SystemDataSqlClientVersion>
Expand Down
50 changes: 0 additions & 50 deletions eng/pipelines/jobs/prepare-signed-artifacts-PR.yml

This file was deleted.

55 changes: 0 additions & 55 deletions eng/pipelines/jobs/prepare-signed-artifacts.yml

This file was deleted.

Loading

0 comments on commit bccc080

Please sign in to comment.