Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Build and sign arcade workloads #26009

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,18 @@
<PublishingVersion>3</PublishingVersion>
<ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
</PropertyGroup>

<ItemGroup>
<_InstallerManifestFilesToPublish Include="$(ArtifactsShippingPackagesDir)\**\*.zip" />
</ItemGroup>

<Target Name="_PublishBlobItems">
<ItemGroup>
<ItemsToPushToBlobFeed Include="@(_InstallerManifestFilesToPublish)">
<IsShipping>true</IsShipping>
<PublishFlatContainer>true</PublishFlatContainer>
<RelativeBlobPath>$(_UploadPathRoot)/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
</ItemsToPushToBlobFeed>
</ItemGroup>
</Target>
</Project>
13 changes: 13 additions & 0 deletions eng/Signing.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,18 @@
<FileSignInfo Include="SegoeUI-Semibold.ttf" CertificateName="3PartySHA2" />

</ItemGroup>

<ItemGroup>
<FileExtensionSignInfo Update=".nupkg" CertificateName="NuGet" />
<FileExtensionSignInfo Update=".zip" CertificateName="None" />
<FileExtensionSignInfo Include=".msi" CertificateName="MicrosoftDotNet500" />
</ItemGroup>

<ItemGroup>
<ItemsToSign Include="$(ArtifactsShippingPackagesDir)\**\*.msi" Condition="'$(PostBuildSign)' != 'true'" />
<ItemsToSign Include="$(ArtifactsShippingPackagesDir)**\*.wixpack.zip" Condition="'$(PostBuildSign)' != 'true'" />
<ItemsToSignPostBuild Include="$(ArtifactsShippingPackagesDir)\**\*.msi" Condition="'$(PostBuildSign)' == 'true'" />
<ItemsToSign Include="$(ArtifactsShippingPackagesDir)\**\*.zip" Condition="'$(PostBuildSign)' != 'true'" />
<ItemsToSignPostBuild Include="$(ArtifactsShippingPackagesDir)\**\*.zip" Condition="'$(PostBuildSign)' == 'true'" />
</ItemGroup>
</Project>
53 changes: 29 additions & 24 deletions eng/pipelines/common/build-test-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ parameters:
- name: runAsPublic
type: boolean
default: false
- name: runAsInternal
type: boolean
default: true
- name: buildScript
type: string
- name: buildConfig
Expand Down Expand Up @@ -132,27 +135,29 @@ steps:
$(_OfficialBuildIdArgs)
displayName: Pack, Sign & Publish

# - script: ${{ parameters.buildScript }}
# -restore -build
# -sign $(_SignArgs)
# -publish $(_PublishArgs)
# -configuration $(_BuildConfig)
# /bl:${{ parameters.repoLogPath }}/build-workloads.binlog
# -projects src/Workload/workloads.csproj
# $(_OfficialBuildIdArgs)
# displayName: Build Workloads

# - ${{ if eq(parameters.runAsPublic, 'true') }}:
# - task: PublishPipelineArtifact@1
# displayName: Publish VSDrop MSIs
# inputs:
# targetPath: '$(Build.SourcesDirectory)/artifacts/VSSetup/$(_BuildConfig)'
# artifactName: VSDropInsertion
# publishLocation: 'pipeline'

# - ${{ if ne(parameters.runAsPublic, 'true') }}:
# - task: 1ES.PublishPipelineArtifact@1
# displayName: Publish VSDrop MSIs
# inputs:
# targetPath: '$(Build.SourcesDirectory)/artifacts/VSSetup/$(_BuildConfig)'
# artifactName: VSDropInsertion
- ${{ if and(eq(parameters.isWindows, 'true'), eq(parameters.runAsInternal, 'true') ) }}:
# only for workloads
- script: ${{ parameters.buildScript }}
-restore -build
-sign $(_SignArgs)
-publish $(_PublishArgs)
-configuration $(_BuildConfig)
/bl:${{ parameters.repoLogPath }}/build-workloads.binlog
-projects src/Workload/workloads.csproj
$(_OfficialBuildIdArgs)
displayName: Build Workloads

- ${{ if eq(parameters.runAsPublic, 'true') }}:
- task: PublishPipelineArtifact@1
displayName: Publish VSDrop MSIs
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/VSSetup/$(_BuildConfig)'
artifactName: VSDropInsertion
publishLocation: 'pipeline'

- ${{ if ne(parameters.runAsPublic, 'true') }}:
- task: 1ES.PublishPipelineArtifact@1
displayName: Publish VSDrop MSIs
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/VSSetup/$(_BuildConfig)'
artifactName: VSDropInsertion
5 changes: 3 additions & 2 deletions eng/pipelines/common/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ variables:
- name: _InternalBuildArgs
value: ''

# Variable groups required for private builds
- group: Xamarin-Secrets
# Variable groups required for private builds but not prs
- ${{ if ne(variables['Build.DefinitionName'], 'maui-pr') }}:
- group: Xamarin-Secrets

- ${{ if or(eq(variables['System.TeamProject'], 'DevDiv'), eq(variables['Build.DefinitionName'], 'dotnet-maui')) }}:
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
Expand Down
104 changes: 0 additions & 104 deletions src/Workload/maui.vsmanproj

This file was deleted.

71 changes: 28 additions & 43 deletions src/Workload/workloads.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<_RootDir Condition=" '$(BUILD_STAGINGDIRECTORY)' != '' ">$([MSBuild]::EnsureTrailingSlash($(BUILD_STAGINGDIRECTORY)))</_RootDir>
<_RootDir Condition=" '$(_RootDir)' == '' ">$(MauiRootDirectory)</_RootDir>
<OutputPath>$(_RootDir)\artifacts\</OutputPath>
<ManifestOutputPath>$(OutputPath)manifests</ManifestOutputPath>
<PreviewManifestOutputPath>$(OutputPath)manifests-pre</PreviewManifestOutputPath>
<PackManifestOutputPath>$(OutputPath)manifests-packs</PackManifestOutputPath>
<ManifestOutputPath>$(ArtifactsShippingPackagesDir)/manifests</ManifestOutputPath>
<PreviewManifestOutputPath>$(ArtifactsShippingPackagesDir)/manifests-pre</PreviewManifestOutputPath>
<PackManifestOutputPath>$(ArtifactsShippingPackagesDir)/manifests-packs</PackManifestOutputPath>
<MsiNuGetOutputPath>$(ArtifactsShippingPackagesDir)</MsiNuGetOutputPath>
<NuGetPackagePath Condition=" '$(NuGetPackagePath)' == '' ">$(ArtifactsShippingPackagesDir)</NuGetPackagePath>
<WorkloadMsiGenProps Condition=" '$(WorkloadMsiGenProps)' == '' ">$(ArtifactsShippingPackagesDir)/vs-workload.props</WorkloadMsiGenProps>
Expand Down Expand Up @@ -44,6 +44,8 @@
https://github.com/dotnet/designs/pull/294
-->
<EnableSideBySideManifests Condition=" '$(EnableSideBySideManifests)' == '' ">false</EnableSideBySideManifests>

<UseVisualStudioComponentPrefix Condition=" '$(UseVisualStudioComponentPrefix)' == '' ">false</UseVisualStudioComponentPrefix>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -127,16 +129,11 @@
<Output TaskParameter="Msis" ItemName="VSWorkloadMsis" />
<Output TaskParameter="SwixProjects" ItemName="SwixProjects" />
</CreateVisualStudioWorkload>
<ItemGroup>
<FilesToSign Include="$(OutputPath)**\*.msi">
<Authenticode>Microsoft400</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>

<Target Name="_GenerateManifestsAndMsiNuGets"
AfterTargets="SignFiles" >
<!-- Create NUPKGs containing MSIs -->
<!-- Create NUPKGs containing MSIs -->
<MSBuild
Projects="%(VSWorkloadMsis.PackageProject)"
Targets="Restore;Pack"
Expand All @@ -145,50 +142,38 @@

<!-- Split swix projects into "components", "components.pre", and "packs" groups to create drops based on %(SwixProjects.PackageType) and %(SwixProjects.IsPreview) -->
<ItemGroup>
<PacksSwixProjects Include="@(SwixProjects)" Condition=" '%(PackageType)' == 'msi-pack' " />
<ComponentsSwixProjects Include="@(SwixProjects)" Condition=" '%(PackageType)' == 'msi-manifest' or '%(PackageType)' == 'manifest-package-group' or ('%(PackageType)' == 'component' and '%(IsPreview)' != 'true') " />
<ComponentsSwixProjectsPreview Include="@(SwixProjects)" Condition=" '%(PackageType)' == 'msi-manifest' or '%(PackageType)' == 'manifest-package-group' or ('%(PackageType)' == 'component' and '%(IsPreview)' == 'true') " />
<SwixWorkloadPackProjects Include="@(SwixProjects)" Condition=" '%(PackageType)' == 'msi-pack' "
ManifestOutputPath="$(PackManifestOutputPath)"
ZipFile="Workload.VSDrop.$(TargetName).$(ManifestBuildVersion).packs.zip" />
<SwixComponentsAndManifests Include="@(SwixProjects)" Condition=" '%(PackageType)' == 'msi-manifest' or '%(PackageType)' == 'manifest-package-group' or ('%(PackageType)' == 'component' and '%(IsPreview)' != 'true') "
ManifestOutputPath="$(ManifestOutputPath)"
ZipFile="Workload.VSDrop.$(TargetName).$(ManifestBuildVersion).components.zip"/>
<SwixPreviewComponentsAndManifests Include="@(SwixProjects)" Condition=" '%(PackageType)' == 'msi-manifest' or '%(PackageType)' == 'manifest-package-group' or ('%(PackageType)' == 'component' and '%(IsPreview)' == 'true') "
ManifestOutputPath="$(PreviewManifestOutputPath)"
ZipFile="Workload.VSDrop.$(TargetName).$(ManifestBuildVersion)-pre.components.zip"/>
<PartitionedSwixProjects Include="@(SwixWorkloadPackProjects);@(SwixComponentsAndManifests);@(SwixPreviewComponentsAndManifests)" />
</ItemGroup>

<!-- Create "components" VS manifests -->
<MSBuild
Projects="%(ComponentsSwixProjects.Identity)"
Properties="SwixBuildTargets=$(SwixTargetsPath);ManifestOutputPath=$(ManifestOutputPath)"
/>
<MSBuild
Projects="$(MSBuildThisFileDirectory)\maui.vsmanproj"
Targets="Restore;GenerateSetupManifest"
Properties="SwixBuildTargets=$(SwixTargetsPath);WorkloadMsiGenProps=$(WorkloadMsiGenProps);ManifestOutputPath=$(ManifestOutputPath);TargetName=$(TargetName).components;ManifestBuildNumber=$(DropBuildNumber)/vs-components"
/>
<MSBuild Projects="@(PartitionedSwixProjects)" Properties="SwixBuildTargets=$(SwixTargetsPath);ManifestOutputPath=%(ManifestOutputPath)"/>

<!-- Create the zip files used for VSDROP creation. -->
<!-- Generate metadata for VSDROP automation. This information cannot be obtained during staging when insertions are triggered -->
<ItemGroup>
<VSDrop Include="%(PartitionedSwixProjects.ZipFile)" SourceDirectory="%(ManifestOutputPath)" />
<VSDropMetadata Include="$(ManifestBuildVersion)" />
<VSDropMetadata Include="$(BUILD_REPOSITORY_NAME)" />
<VSDropMetadata Include="$(BUILD_SOURCEBRANCH)" />
</ItemGroup>
<WriteLinesToFile File="%(VSDrop.SourceDirectory)\.metadata" Lines="@(VSDropMetadata)" Overwrite="true" />
<ZipDirectory Overwrite="true" SourceDirectory="%(VSDrop.SourceDirectory)" DestinationFile="$(ArtifactsShippingPackagesDir)/%(VSDrop.Identity)" />

<!-- Create and copy "components.pre" VS manifests to the "components" manifest output path so any build can use preview manifests if requested -->
<MSBuild
Projects="%(ComponentsSwixProjectsPreview.Identity)"
Properties="SwixBuildTargets=$(SwixTargetsPath);ManifestOutputPath=$(PreviewManifestOutputPath)"
/>
<MSBuild
Projects="$(MSBuildThisFileDirectory)\maui.vsmanproj"
Targets="Restore;GenerateSetupManifest"
Properties="SwixBuildTargets=$(SwixTargetsPath);WorkloadMsiGenProps=$(WorkloadMsiGenProps);ManifestOutputPath=$(PreviewManifestOutputPath);TargetName=$(TargetName).components.pre;ManifestBuildNumber=$(DropBuildNumber)/vs-components"
/>
<ItemGroup>
<PreviewManifests Include="$(PreviewManifestOutputPath)\*" />
</ItemGroup>
<Copy
SourceFiles="@(PreviewManifests)"
DestinationFolder="$(ManifestOutputPath)"
/>

<!-- Create "packs" VS manifests that can be referenced by different "components" to support building alternate target framework versions -->
<MSBuild
Projects="%(PacksSwixProjects.Identity)"
Properties="SwixBuildTargets=$(SwixTargetsPath);ManifestOutputPath=$(PackManifestOutputPath)"
/>
<MSBuild
Projects="$(MSBuildThisFileDirectory)\maui.vsmanproj"
Targets="Restore;GenerateSetupManifest"
Properties="SwixBuildTargets=$(SwixTargetsPath);WorkloadMsiGenProps=$(WorkloadMsiGenProps);ManifestOutputPath=$(PackManifestOutputPath);TargetName=$(TargetName).packs;ManifestBuildNumber=$(DropBuildNumber)/vs-packs"
/>
</Target>

<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
Expand Down
Loading