condition: succeeded()
# Create nuget packages, sign binaries and publish to blob feed
-
- - script: $(Build.SourcesDirectory)\eng\cipack.cmd
- -configuration Release
- -prepareMachine
- -verbosity normal
- $(_InternalBuildArgs)
- displayName: Package
- continueOnError: true
- condition: succeeded()
-
- - script: $(Build.SourcesDirectory)\build.cmd
- -configuration Release
- -ci
- -bundletools
- -verbosity normal
- $(_InternalBuildArgs)
- displayName: Create Single File Bundles
- continueOnError: true
- condition: succeeded()
-
- - powershell: $(Build.SourcesDirectory)\eng\common\build.ps1
- -configuration Release
- -prepareMachine
- -verbosity normal
- -restore -publish -sign
- -ci -nobl
- /bl:$(Build.SourcesDirectory)/artifacts/log/Release/SignPublish.binlog
- $(_InternalBuildArgs)
- displayName: Sign and generate manifests
- continueOnError: true
+ - script: $(Build.SourcesDirectory)\eng\ci-prepare-artifacts.cmd $(_InternalBuildArgs)
+ displayName: Package, Sign, and Publish
+ continueOnError: false
condition: succeeded()
# Publish package and log build artifacts
+++ /dev/null
-<Project>
-
- <PropertyGroup>
- <!-- Since Arcade SDK's AfterSigning.proj file does not import the Arcard SDK, this
- setting is necessary because we are manually importing the Arcade SDK targets
- below in order to get the GenerateChecksums target. -->
- <_SuppressSdkImports>false</_SuppressSdkImports>
- </PropertyGroup>
-
- <Target Name="CollectGenerateChecksumItems">
- <ItemGroup>
- <NuGetPackageFile Include="$(ArtifactsPackagesDir)**\*.nupkg" />
- <GenerateChecksumItems Include="%(NuGetPackageFile.Identity)"
- Condition="$([System.IO.File]::Exists('%(NugetPackageFile.Identity).blobgroup'))" >
- <DestinationPath>%(FullPath).sha512</DestinationPath>
- </GenerateChecksumItems>
- </ItemGroup>
- </Target>
-
- <Target Name="GenerateSignedPackageChecksums"
- AfterTargets="Pack"
- DependsOnTargets="CollectGenerateChecksumItems;GenerateChecksums" />
-
- <Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
-
-</Project>
\ No newline at end of file
<Project>
+ <PropertyGroup>
+ <!-- Since Arcade SDK's AfterSigning.proj file does not import the Arcade SDK, this
+ setting is necessary because we are manually importing the Arcade SDK targets
+ below in order to get the GenerateChecksums target. -->
+ <_SuppressSdkImports>false</_SuppressSdkImports>
+ </PropertyGroup>
<PropertyGroup>
<BundleOutputDir>$(ArtifactsDir)bundledtools/</BundleOutputDir>
</Target>
+ <Target Name="GenerateChecksumsForBlobgroups">
+ <ItemGroup>
+ <GenerateChecksumItems Include="%(PackageFile.Identity)"
+ Condition="$([System.IO.File]::Exists('%(PackageFile.Identity).blobgroup'))" >
+ <DestinationPath>%(FullPath).sha512</DestinationPath>
+ </GenerateChecksumItems>
+ </ItemGroup>
+
+ <GenerateChecksums Items="@(GenerateChecksumItems)" />
+ </Target>
+
<!-- Run the CollectPackageArtifactFiles target on each PackageFile by target batching on a non-existing file.
This allows using the ReadLinesFromFile task to read the blob group file, which was written with WriteLinesToFile,
thus avoiding erroneously reading in the newline at the end of the blob group file. -->
<Target Name="CollectPackageArtifactFiles"
+ DependsOnTargets="GenerateChecksumsForBlobgroups"
Inputs="@(PackageFile)"
Outputs="%(PackageFile.Identity).notexist">
<PropertyGroup>
<_BlobGroupFilePath>%(PackageFile.FullPath).blobgroup</_BlobGroupFilePath>
<_ChecksumFilePath>%(PackageFile.FullPath).sha512</_ChecksumFilePath>
- </PropertyGroup>
+ </PropertyGroup>
+
+ <Error Condition="Exists('$(_BlobGroupFilePath)') and !Exists('$(_ChecksumFilePath)')"
+ Text="Expected SHA512 hash for %(PackageFile.FullPath) not found at $(_ChecksumFilePath)"/>
<!-- Read in blob group name, if it exists -->
<ReadLinesFromFile File="$(_BlobGroupFilePath)" Condition="Exists('$(_BlobGroupFilePath)')">
</ItemGroup>
<!-- Add artifact items to be pushed to blob feed -->
- <ItemGroup>
+ <ItemGroup>
<ItemsToPushToBlobFeed Include="@(_BlobItem)" Condition="'$(_BlobGroupName)' != ''">
<RelativeBlobPath>diagnostics/$(_BlobGroupName)/%(_BlobItem.Filename)%(_BlobItem.Extension)</RelativeBlobPath>
<PublishFlatContainer>true</PublishFlatContainer>
</ItemGroup>
</Target>
-</Project>
\ No newline at end of file
+ <Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
+</Project>
# Install sdk for building, restore and build managed components.
if (-not $skipmanaged) {
- Invoke-Expression "& `"$engroot\common\build.ps1`" -build -binaryLog -configuration $configuration -verbosity $verbosity /p:BuildArch=$architecture /p:TestArchitectures=$architecture $remainingargs"
+ Invoke-Expression "& `"$engroot\common\build.ps1`" -build -configuration $configuration -verbosity $verbosity /p:BuildArch=$architecture /p:TestArchitectures=$architecture $remainingargs"
if ($lastExitCode -ne 0) {
exit $lastExitCode
}
--- /dev/null
+@echo off
+setlocal
+
+set "_commonArgs=-restore -ci -prepareMachine -verbosity minimal -configuration Release"
+set "_logDir=%~dp0..\artifacts\log\Release\"
+
+echo Creating packages
+powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0common\Build.ps1""" %_commonArgs% -pack -noBl /bl:'%_logDir%Pack.binlog' %*"
+if NOT '%ERRORLEVEL%' == '0' goto ExitWithCode
+
+echo Creating bundles
+powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" %_commonArgs% -bundletools %*"
+if NOT '%ERRORLEVEL%' == '0' goto ExitWithCode
+
+echo Signing and publishing manifest
+powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0common\Build.ps1""" %_commonArgs% -sign -publish -noBl /bl:'%_logDir%SignPublish.binlog' %*"
+if NOT '%ERRORLEVEL%' == '0' goto ExitWithCode
+
+exit /b 0
+
+:ExitWithCode
+exit /b !__exitCode!
+++ /dev/null
-@echo off
-powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0common\Build.ps1""" -restore -pack -ci %*"
-exit /b %ErrorLevel%
This uses the private ItemGroup _FilesToBundle that gets populated in the target chain:
ComputeFilesToPublish -> GenerateSingleFileBundle -> _ComputeFilesToBundle.
There was no extensibility point to get this, but the single file team confirmed this
- would be the cleanest way currently and that it allows to easily consume the extension point when added. -->
+ would be the cleanest way currently and that it allows to easily consume the extension point when added.
+
+ The exclusion is to make sure we don't sign the apphost before bundling the final tool.
+ In pre 5.0-rc1 SDK's we have that the single-file host is named after the app. Afterwards
+ we have it's just called apphost with some metadata. Discard both posibilities. -->
<Target Name="CollectBundleFilesToSign"
DependsOnTargets="ComputeFilesToPublish"
AfterTargets="ComputeFilesToPublish"
Returns="@(FilesInBundleToSign)">
<ItemGroup>
- <FilesInBundleToSign Include="@(_FilesToBundle)" Condition="'%(_FilesToBundle.FileName)%(_FilesToBundle.Extension)' != '$(PublishedSingleFileName)'"/>
+ <FilesInBundleToSign
+ Include="@(_FilesToBundle)"
+ Condition="('%(_FilesToBundle.FileName)%(_FilesToBundle.Extension)' != '$(PublishedSingleFileName)') and
+ ('%(_FilesToBundle.RelativePath)' != '$(PublishedSingleFileName)') "/>
</ItemGroup>
<Message Importance="Low" Text="@(FilesInBundleToSign)"/>
</Target>