* 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
This commit is contained in:
Viktor Hofer 2024-03-18 20:26:14 +01:00 коммит произвёл GitHub
Родитель 570b297757
Коммит bccc0807fc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
15 изменённых файлов: 160 добавлений и 519 удалений

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

@ -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
@ -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

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

@ -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)
@ -60,34 +60,32 @@ 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
@ -95,15 +93,11 @@ extends:
# 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: >-

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

@ -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
eng/AfterSigning.targets Normal file
Просмотреть файл

@ -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>

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

@ -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;
@ -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>

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

@ -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>

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

@ -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>

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

@ -1,50 +0,0 @@
parameters:
dependsOn: []
PublishRidAgnosticPackagesFromJobName: ''
jobs:
- job: PrepareSignedArtifacts
displayName: Prepare Signed Artifacts
dependsOn: ${{ parameters.dependsOn }}
pool:
name: NetCore1ESPool-Svc-Internal
demands: ImageOverride -equals windows.vs2019.amd64
# Double the default timeout.
timeoutInMinutes: 120
workspace:
clean: all
steps:
- task: DownloadBuildArtifacts@0
displayName: Download IntermediateUnsignedArtifacts
inputs:
artifactName: IntermediateUnsignedArtifacts
downloadPath: $(Build.SourcesDirectory)\artifacts\PackageDownload
- script: >
build.cmd -ci
-projects $(Build.SourcesDirectory)\src\publish\prepare-artifacts.proj
-c Release
/p:PublishRidAgnosticPackagesFromJobName=${{ parameters.PublishRidAgnosticPackagesFromJobName }}
/p:SignType=$(SignType)
/p:DotNetSignType=$(SignType)
/bl:$(Build.SourcesDirectory)\prepare-artifacts.binlog
displayName: Prepare artifacts and upload to build
- task: CopyFiles@2
displayName: Copy Files to $(Build.StagingDirectory)\BuildLogs
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*.log
**/*.binlog
TargetFolder: '$(Build.StagingDirectory)\BuildLogs'
continueOnError: true
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: Publish Artifact BuildLogs
inputs:
PathtoPublish: '$(Build.StagingDirectory)\BuildLogs'
ArtifactName: Logs-PrepareSignedArtifacts
condition: succeededOrFailed()

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

@ -1,55 +0,0 @@
parameters:
dependsOn: []
PublishRidAgnosticPackagesFromJobName: ''
jobs:
- job: PrepareSignedArtifacts
displayName: Prepare Signed Artifacts
dependsOn: ${{ parameters.dependsOn }}
# Double the default timeout.
timeoutInMinutes: 120
workspace:
clean: all
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish Artifact BuildLogs'
condition: succeededOrFailed()
targetPath: '$(Build.StagingDirectory)\BuildLogs'
artifactName: Logs-PrepareSignedArtifacts
steps:
- task: NuGetAuthenticate@1
- task: MicroBuildSigningPlugin@2
displayName: Install MicroBuild plugin for Signing
inputs:
signType: $(SignType)
zipSources: false
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
condition: and(succeeded(), in(variables['SignType'], 'real', 'test'))
- task: DownloadBuildArtifacts@0
displayName: Download IntermediateUnsignedArtifacts
inputs:
artifactName: IntermediateUnsignedArtifacts
downloadPath: $(Build.SourcesDirectory)\artifacts\PackageDownload
- script: >
build.cmd -ci
-projects $(Build.SourcesDirectory)\src\publish\prepare-artifacts.proj
-c Release
/p:PublishRidAgnosticPackagesFromJobName=${{ parameters.PublishRidAgnosticPackagesFromJobName }}
/p:SignType=$(SignType)
/p:DotNetSignType=$(SignType)
/bl:$(Build.SourcesDirectory)\prepare-artifacts.binlog
displayName: Prepare artifacts and upload to build
- task: CopyFiles@2
displayName: Copy Files to $(Build.StagingDirectory)\BuildLogs
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*.log
**/*.binlog
TargetFolder: '$(Build.StagingDirectory)\BuildLogs'
continueOnError: true
condition: succeededOrFailed()

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

@ -11,7 +11,7 @@ jobs:
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
pool:
# Use a hosted pool when possible.
vmImage: 'windows-2019'
vmImage: 'windows-2022'
strategy:
matrix:
Debug:
@ -24,7 +24,6 @@ jobs:
- name: CommonMSBuildArgs
value: >-
-c $(_BuildConfig)
/p:OfficialBuildId=$(OfficialBuildId)
/p:TargetArchitecture=${{ parameters.targetArchitecture }}
/p:SkipTests=${{ parameters.skipTests }}
- name: MsbuildSigningArguments
@ -41,12 +40,40 @@ jobs:
displayName: Clear NuGet http cache (if exists)
- script: >-
build.cmd -ci -test
eng/common/cibuild.cmd
$(CommonMSBuildArgs)
$(MsbuildSigningArguments)
$(_InternalRuntimeDownloadArgs)
displayName: Build
- template: /eng/pipelines/steps/upload-job-artifacts-PR.yml
parameters:
name: ${{ parameters.name }}
- ${{ if ne(parameters.skipTests, 'true') }}:
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'xUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
mergeTestResults: true
testRunTitle: ${{ parameters.name }}-$(_BuildConfig)
continueOnError: true
condition: always()
- task: CopyFiles@2
displayName: Prepare BuildLogs staging directory
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*.log
**/*.binlog
TargetFolder: '$(Build.StagingDirectory)/BuildLogs'
CleanTargetFolder: true
continueOnError: true
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: Publish BuildLogs
inputs:
PathtoPublish: '$(Build.StagingDirectory)/BuildLogs'
ArtifactName: Logs-${{ parameters.name }}-$(_BuildConfig)
continueOnError: true
condition: succeededOrFailed()

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

@ -11,8 +11,6 @@ jobs:
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
strategy:
matrix:
Debug:
_BuildConfig: Debug
Release:
_BuildConfig: Release
workspace:
@ -22,6 +20,7 @@ jobs:
value: >-
-c $(_BuildConfig)
/p:OfficialBuildId=$(OfficialBuildId)
/p:DotNetPublishUsingPipelines=true
/p:TargetArchitecture=${{ parameters.targetArchitecture }}
/p:SkipTests=${{ parameters.skipTests }}
- name: MsbuildSigningArguments
@ -36,12 +35,6 @@ jobs:
templateContext:
outputs:
- output: buildArtifacts
displayName: 'Publish Artifacts'
condition: and(succeeded(), eq(variables._BuildConfig, 'Release'))
PathtoPublish: '$(Build.StagingDirectory)/Artifacts'
ArtifactName: IntermediateUnsignedArtifacts
ArtifactType: container
- output: pipelineArtifact
displayName: 'Publish BuildLogs'
condition: succeededOrFailed()
@ -72,7 +65,7 @@ jobs:
displayName: Clear NuGet http cache (if exists)
- script: >-
build.cmd -ci -test
eng/common/cibuild.cmd
$(CommonMSBuildArgs)
$(MsbuildSigningArguments)
$(_InternalRuntimeDownloadArgs)
@ -83,6 +76,37 @@ jobs:
parameters:
name: Generate_SBOM_${{ parameters.name }}
- template: /eng/pipelines/steps/upload-job-artifacts.yml@self
parameters:
name: ${{ parameters.name }}
# Upload build outputs as build artifacts.
- task: CopyFiles@2
displayName: Prepare job-specific Artifacts subdirectory
inputs:
SourceFolder: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)'
Contents: |
Shipping/**/*
NonShipping/**/*
TargetFolder: '$(Build.StagingDirectory)/Artifacts/${{ parameters.name }}'
CleanTargetFolder: true
condition: and(succeeded(), eq(variables._BuildConfig, 'Release'))
- ${{ if ne(parameters.skipTests, 'true') }}:
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'xUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
mergeTestResults: true
testRunTitle: ${{ parameters.name }}-$(_BuildConfig)
continueOnError: true
- task: CopyFiles@2
displayName: Prepare BuildLogs staging directory
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*.log
**/*.binlog
TargetFolder: '$(Build.StagingDirectory)/BuildLogs'
CleanTargetFolder: true
continueOnError: true
condition: succeededOrFailed()

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

@ -1,35 +0,0 @@
parameters:
name: ''
steps:
# Always upload test outputs and build logs.
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'xUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
mergeTestResults: true
testRunTitle: ${{ parameters.name }}-$(_BuildConfig)
continueOnError: true
condition: always()
- task: CopyFiles@2
displayName: Prepare BuildLogs staging directory
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*.log
**/*.binlog
TargetFolder: '$(Build.StagingDirectory)/BuildLogs'
CleanTargetFolder: true
continueOnError: true
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: Publish BuildLogs
inputs:
PathtoPublish: '$(Build.StagingDirectory)/BuildLogs'
ArtifactName: Logs-${{ parameters.name }}-$(_BuildConfig)
continueOnError: true
condition: succeededOrFailed()

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

@ -1,39 +0,0 @@
parameters:
name: ''
steps:
# Upload build outputs as build artifacts.
- task: CopyFiles@2
displayName: Prepare job-specific Artifacts subdirectory
inputs:
SourceFolder: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)'
Contents: |
Shipping/**/*
NonShipping/**/*
TargetFolder: '$(Build.StagingDirectory)/Artifacts/${{ parameters.name }}'
CleanTargetFolder: true
condition: and(succeeded(), eq(variables._BuildConfig, 'Release'))
# Always upload test outputs and build logs.
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'xUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
mergeTestResults: true
testRunTitle: ${{ parameters.name }}-$(_BuildConfig)
continueOnError: true
condition: always()
- task: CopyFiles@2
displayName: Prepare BuildLogs staging directory
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*.log
**/*.binlog
TargetFolder: '$(Build.StagingDirectory)/BuildLogs'
CleanTargetFolder: true
continueOnError: true
condition: succeededOrFailed()

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

@ -1,255 +0,0 @@
<Project Sdk="Microsoft.Build.NoTargets" InitialTargets="FindDownloadedArtifacts">
<PropertyGroup>
<TargetFramework>$(NetCurrent)</TargetFramework>
<!-- Set IsStableBuild to mimic https://github.com/dotnet/arcade/blob/694d59f090b743f894779d04a7ffe11cbaf352e7/src/Microsoft.DotNet.Arcade.Sdk/tools/Publish.proj#L30-L31 -->
<IsStableBuild>false</IsStableBuild>
<IsStableBuild Condition="'$(DotNetFinalVersionKind)' == 'release'">true</IsStableBuild>
<!-- Don't stabilize the package version in order to retrieve the VersionSuffix. -->
<IsShipping>false</IsShipping>
<DownloadDirectory>$(ArtifactsDir)PackageDownload/</DownloadDirectory>
<!-- Construct the path to the sign project, so that signing can be called during prepare-artifacts -->
<ArcadeSdkMSBuildProjectDir>$([System.IO.Path]::GetDirectoryName('$(ArcadeSdkBuildTasksAssembly)'))\..\</ArcadeSdkMSBuildProjectDir>
<ArcadeSdkSignProject>$(ArcadeSdkMSBuildProjectDir)Sign.proj</ArcadeSdkSignProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(MicrosoftDotNetBuildTasksFeedVersion)" />
<PackageReference Include="Microsoft.DotNet.VersionTools.Tasks" Version="$(MicrosoftDotNetVersionToolsTasksVersion)" />
</ItemGroup>
<!-- When doing post build sign, pull in the arcade sign.props file, which will
create some initial sign groups and then pulls in the repo's custom Signing.props overrides.
Before importing the signing props. Set PrepareArtifactst=true. Depending on context (SDK project vs. not),
the initial imports of livebuilds.targets and Configuration.props are already imported and thus cannot
be imported again. Without those imports, the globbing of files to sign will not work properly. -->
<PropertyGroup>
<PrepareArtifacts>true</PrepareArtifacts>
</PropertyGroup>
<Import Project="../tools/Sign.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="$(RepositoryEngineeringDir)Publishing.props" Condition="Exists('$(RepositoryEngineeringDir)Publishing.props')" />
<!-- Since this repo doesn't use publish.proj, update the incoming arcade defaults to use MicrosoftDotNet500 -->
<ItemGroup>
<FileExtensionSignInfo Update="@(FileExtensionSignInfo->WithMetadataValue('CertificateName','Microsoft400'))" CertificateName="$(DotNetCertificateName)" />
<StrongNameSignInfo Update="@(StrongNameSignInfo->WithMetadataValue('CertificateName','Microsoft400'))" CertificateName="$(DotNetCertificateName)" />
<FileSignInfo Update="@(FileSignInfo->WithMetadataValue('CertificateName','Microsoft400'))" CertificateName="$(DotNetCertificateName)" />
</ItemGroup>
<!--
Run Arcade's signing project directly, since this project doesn't use the arcade SDK.
-->
<Target Name="SignArtifacts" Condition="'$(PostBuildSign)' != 'true'">
<MSBuild
Projects="$(ArcadeSdkSignProject)"
Targets="Sign"
Properties="
DownloadDirectory=$(DownloadDirectory);
PrepareArtifacts=$(PrepareArtifacts)" />
</Target>
<!--
Set metadata for assets that are not marked as NonShipping.
This is used to determine if the asset should be shipped as part of .NET release.
-->
<ItemDefinitionGroup>
<ItemsToPush>
<ManifestArtifactData Condition="'$(ProducesDotNetReleaseShippingAssets)' == 'true'">DotNetReleaseShipping=true</ManifestArtifactData>
</ItemsToPush>
</ItemDefinitionGroup>
<Target Name="PreparePublishToAzureBlobFeed"
AfterTargets="Build"
DependsOnTargets="FindDownloadedArtifacts;SignArtifacts;GenerateChecksums">
<PropertyGroup>
<InstallersRelativePath>WindowsDesktop/$(Version)/</InstallersRelativePath>
<AssetManifestFilename>Manifest.xml</AssetManifestFilename>
<AssetManifestFile>$(ArtifactsLogDir)AssetManifest/$(AssetManifestFilename)</AssetManifestFile>
<!-- Create temp dir to store generated asset manifest, per Arcade guidance. -->
<TempWorkingDir>$(ArtifactsObjDir)TempWorkingDir\$([System.Guid]::NewGuid())\</TempWorkingDir>
<ProductVersionTxtContents Condition="'$(DotNetFinalVersionKind)' == 'release'">$(VersionPrefix)</ProductVersionTxtContents>
<ProductVersionTxtContents Condition="'$(DotNetFinalVersionKind)' != 'release'">$(Version)</ProductVersionTxtContents>
</PropertyGroup>
<!-- Generate windowsdesktop-productVersion.txt containing the value of $(PackageVersion) -->
<WriteLinesToFile
File="$(ArtifactsShippingPackagesDir)windowsdesktop-productVersion.txt"
Lines="$(ProductVersionTxtContents)"
Overwrite="true"
Encoding="ASCII" />
<!-- Generate productVersion.txt containing the value of $(PackageVersion) -->
<WriteLinesToFile
File="$(ArtifactsShippingPackagesDir)productVersion.txt"
Lines="$(ProductVersionTxtContents)"
Overwrite="true"
Encoding="ASCII" />
<ItemGroup>
<ItemsToPush Remove="@(ItemsToPush)" />
<ItemsToPush Include="@(ShippingNupkgToPublishFile)" />
<ItemsToPush Include="@(NonShippingNupkgToPublishFile)" ManifestArtifactData="NonShipping=true" />
<ItemsToPush Include="@(SymbolNupkgToPublishFile)" />
<ItemsToPush
Include="@(DownloadedNonShippingArtifactFile)"
Exclude="@(DownloadedSymbolNupkgFile);@(DownloadedNupkgFile)">
<RelativeBlobPath>$(InstallersRelativePath)%(Filename)%(Extension)</RelativeBlobPath>
<PublishFlatContainer>true</PublishFlatContainer>
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
</ItemsToPush>
<ItemsToPush
Include="@(DownloadedShippingArtifactFile)"
Exclude="@(DownloadedSymbolNupkgFile);@(DownloadedNupkgFile)">
<RelativeBlobPath>$(InstallersRelativePath)%(Filename)%(Extension)</RelativeBlobPath>
<PublishFlatContainer>true</PublishFlatContainer>
</ItemsToPush>
<!-- Must be a different item as otherwise FileName and Extension would refer to the wrong identity. -->
<GeneratedChecksumFile Include="@(GenerateChecksumItems->Metadata('DestinationPath'))" />
<ItemsToPush Include="@(GeneratedChecksumFile)">
<RelativeBlobPath>$(InstallersRelativePath)%(Filename)%(Extension)</RelativeBlobPath>
<Category>Checksum</Category>
<PublishFlatContainer>true</PublishFlatContainer>
</ItemsToPush>
<ItemsToPush Include="$(ArtifactsShippingPackagesDir)windowsdesktop-productVersion.txt">
<RelativeBlobPath>$(InstallersRelativePath)windowsdesktop-productVersion.txt</RelativeBlobPath>
<PublishFlatContainer>true</PublishFlatContainer>
</ItemsToPush>
<ItemsToPush Include="$(ArtifactsShippingPackagesDir)productVersion.txt">
<RelativeBlobPath>$(InstallersRelativePath)productVersion.txt</RelativeBlobPath>
<PublishFlatContainer>true</PublishFlatContainer>
</ItemsToPush>
</ItemGroup>
<!--
The new Maestro/BAR build model keeps separate Azure DevOps and GitHub build information.
The GitHub information will be extracted based on the Azure DevOps repository.
-->
<PropertyGroup>
<CollectionUri>$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)</CollectionUri>
<!-- When we have dev.azure.com/<account>/ -->
<AzureDevOpsAccount Condition="$(CollectionUri.IndexOf('dev.azure.com')) >= 0">$(CollectionUri.Split('/')[3])</AzureDevOpsAccount>
<!-- When we have <account>.visualstudio.com -->
<AzureDevOpsAccount Condition="$(CollectionUri.IndexOf('visualstudio.com')) >= 0">$(CollectionUri.Split('.')[0].Split('/')[2])</AzureDevOpsAccount>
</PropertyGroup>
<ItemGroup>
<ManifestBuildData Include="InitialAssetsLocation=$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)$(SYSTEM_TEAMPROJECT)/_apis/build/builds/$(BUILD_BUILDID)/artifacts" />
<ManifestBuildData Include="AzureDevOpsBuildId=$(BUILD_BUILDID)" />
<ManifestBuildData Include="AzureDevOpsBuildDefinitionId=$(SYSTEM_DEFINITIONID)" />
<ManifestBuildData Include="AzureDevOpsAccount=$(AzureDevOpsAccount)" />
<ManifestBuildData Include="AzureDevOpsProject=$(SYSTEM_TEAMPROJECT)" />
<ManifestBuildData Include="AzureDevOpsBuildNumber=$(BUILD_BUILDNUMBER)" />
<ManifestBuildData Include="AzureDevOpsRepository=$(BUILD_REPOSITORY_URI)" />
<ManifestBuildData Include="AzureDevOpsBranch=$(BUILD_SOURCEBRANCH)" />
</ItemGroup>
<!-- Push items to AzDO as build artifacts, generating the asset manifest as a side effect. -->
<PushToBuildStorage
AzureDevOpsCollectionUri="$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)"
AzureDevOpsProject="$(SYSTEM_TEAMPROJECT)"
AzureDevOpsBuildId="$(BUILD_BUILDID)"
ItemsToSign="@(ItemsToSignPostBuild)"
StrongNameSignInfo="@(StrongNameSignInfo)"
FileSignInfo="@(FileSignInfo)"
FileExtensionSignInfo="@(FileExtensionSignInfo)"
CertificatesSignInfo="@(CertificatesSignInfo)"
ItemsToPush="@(ItemsToPush)"
ManifestBuildData="@(ManifestBuildData)"
ManifestRepoUri="$(BUILD_REPOSITORY_NAME)"
ManifestBranch="$(BUILD_SOURCEBRANCH)"
ManifestBuildId="$(BUILD_BUILDNUMBER)"
ManifestCommit="$(BUILD_SOURCEVERSION)"
IsStableBuild="$(IsStableBuild)"
AssetManifestPath="$(AssetManifestFile)" />
<!-- Copy the generated manifest to the build's artifacts -->
<Copy SourceFiles="$(AssetManifestFile)" DestinationFolder="$(TempWorkingDir)" />
</Target>
<!--
Look through the downloaded artifacts to figure out how to ship them. Creates item groups for
other types of publishing to use.
DownloadDirectory is expected to have some directory inside, which then contains a dir for each
build job name. For example, this nupkg would be found:
$(DownloadDirectory)IntermediateUnsignedArtifacts\win-x64\Shipping\a.nupkg
-->
<Target Name="FindDownloadedArtifacts"
BeforeTargets="GenerateChecksums">
<ItemGroup>
<DefaultArtifactExcludes Include="$(DownloadDirectory)**/*.wixpdb" />
<!-- wixpacks are not needed if signing is enabled in-build -->
<DefaultArtifactExcludes Include="$(DownloadDirectory)**/*.wixpack.zip" Condition="'$(PostBuildSign)' != 'true'" />
<DownloadedNonShippingArtifactFile Include="$(DownloadDirectory)**/NonShipping/**" Exclude="@(DefaultArtifactExcludes)" />
<DownloadedShippingArtifactFile Include="$(DownloadDirectory)**/Shipping/**" Exclude="@(DefaultArtifactExcludes)" />
<DownloadedSymbolNupkgFile Include="$(DownloadDirectory)**\*.symbols.nupkg" />
<DownloadedNupkgFile
Include="$(DownloadDirectory)**\*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />
<!--
Filter out the RID-specific (Runtime) nupkgs and RID-agnostic nupkgs. RID-specific packages
are published from every job. RID-agnostic nupkgs are built with the same ID/version by
every job, so one specific job's outputs must be picked to sign and publish.
-->
<RuntimeNupkgFile
Include="
$(DownloadDirectory)**\*.Runtime.*.nupkg;
$(DownloadDirectory)**\VS.Redist.Common.*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />
<RidAgnosticNupkgToPublishFile
Include="$(DownloadDirectory)*\$(PublishRidAgnosticPackagesFromJobName)\**\*.nupkg"
Exclude="@(RuntimeNupkgFile);@(DownloadedSymbolNupkgFile)" />
<NupkgToPublishFile Include="@(RuntimeNupkgFile);@(RidAgnosticNupkgToPublishFile)" />
<!--
Assuming all symbol packages ship and can be found by turning .nupkg => .symbols.nupkg, find
them. Don't check for missing symbol packages here: some nupkgs don't have them for valid
reasons, such as the VS insertion packages that transport MSIs. Symbol package validation
will check for symbol completeness with file-by-file granularity rather than looking for
missing symbols.nupkg files: https://github.com/dotnet/arcade/issues/2499.
-->
<PotentialSymbolNupkgToPublishFile
Include="@(NupkgToPublishFile->Replace('\NonShipping\', '\Shipping\')->Replace('.nupkg', '.symbols.nupkg'))" />
<SymbolNupkgToPublishFile
Include="@(PotentialSymbolNupkgToPublishFile)"
Condition="Exists('%(Identity)')" />
<GenerateChecksumItems
Include="@(DownloadedShippingArtifactFile)"
Exclude="@(DownloadedSymbolNupkgFile);@(DownloadedNupkgFile)"
DestinationPath="%(FullPath).sha512" />
<!-- Split nupkgs into shipping/nonshipping for BAR categorization. -->
<ShippingNupkgToPublishFile
Include="@(NupkgToPublishFile)"
Condition="$([System.String]::new('%(Identity)').Contains('\Shipping\'))" />
<NonShippingNupkgToPublishFile
Include="@(NupkgToPublishFile)"
Exclude="@(ShippingNupkgToPublishFile)" />
</ItemGroup>
<Error
Condition="'@(SymbolNupkgToPublishFile)' == ''"
Text="No symbol packages found." />
</Target>
</Project>

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

@ -83,11 +83,6 @@ namespace Microsoft.DotNet.WindowsDesktop.App.Tests
HasGoodPlatformManifest();
}
public void IsAppHostPack()
{
IsRuntimeSpecificPack();
}
public void IsRuntimePack()
{
IsRuntimeSpecificPack();