Skip to content
代码片段 群组 项目
未验证 提交 14468ef1 编辑于 作者: William Godbe's avatar William Godbe 提交者: GitHub
浏览文件

[release/6.0] Add RID to targeting pack archive names (#40731)

* [release/6.0] Add RID to targeting pack archive names
* Fixup
上级 ef0bd0f5
No related branches found
No related tags found
无相关合并请求
......@@ -53,7 +53,6 @@ parameters:
# jobDisplayName: '' - use agentOs by default.
artifacts: []
buildDirectory: $(System.DefaultWorkingDirectory)/eng/
installTar: true
installNodeJs: true
installJdk: true
timeoutInMinutes: 180
......@@ -179,9 +178,6 @@ jobs:
Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(Build.SourcesDirectory)\artifacts\tmp\selenium\"
./eng/scripts/InstallGoogleChrome.ps1
displayName: Install Chrome
- ${{ if and(eq(parameters.installTar, 'true'), eq(parameters.agentOs, 'Windows')) }}:
- powershell: ./eng/scripts/InstallTar.ps1
displayName: Find or install Tar
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- powershell: Write-Host "##vso[task.prependpath]$(DOTNET_CLI_HOME)\.dotnet\tools"
displayName: Add dotnet tools to path
......
<#
.SYNOPSIS
Finds or installs the Tar command on this system.
.DESCRIPTION
This script searches for Tar on this system. If not found, downloads and extracts Git to use its tar.exe. Prefers
global installation locations even if Git has been downloaded into this repo.
.PARAMETER GitVersion
The version of the Git to install. If not set, the default value is read from global.json.
.PARAMETER Force
Overwrite the existing installation if one exists in this repo and Tar isn't installed globally.
#>
param(
[string]$GitVersion,
[switch]$Force
)
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
Set-StrictMode -Version 1
# Find tar. If not found, install Git to get it.
$repoRoot = (Join-Path $PSScriptRoot "..\.." -Resolve)
$installDir = "$repoRoot\.tools\Git\win-x64"
$tarCommand = "$installDir\usr\bin\tar.exe"
$finalCommand = "$repoRoot\.tools\tar.exe"
Write-Host "Windows version and other information..."
cmd.exe /c ver
systeminfo.exe
Write-Host "Processor Architecture: $env:PROCESSOR_ARCHITECTURE"
Write-Host "Checking $env:SystemRoot\System32\tar.exe"
Get-ChildItem "$env:SystemRoot\System32\ta*.exe"
if (Test-Path "$env:SystemRoot\System32\tar.exe") {
Write-Host "Found $env:SystemRoot\System32\tar.exe"
$tarCommand = "$env:SystemRoot\System32\tar.exe"
}
elseif (Test-Path "$env:ProgramFiles\Git\usr\bin\tar.exe") {
$tarCommand = "$env:ProgramFiles\Git\usr\bin\tar.exe"
}
elseif (Test-Path "${env:ProgramFiles(x86)}\Git\usr\bin\tar.exe") {
$tarCommand = "${env:ProgramFiles(x86)}\Git\usr\bin\tar.exe"
}
elseif (Test-Path "$env:AGENT_HOMEDIRECTORY\externals\git\usr\bin\tar.exe") {
$tarCommand = "$env:AGENT_HOMEDIRECTORY\externals\git\usr\bin\tar.exe"
}
elseif ((Test-Path $tarCommand) -And (-Not $Force)) {
Write-Verbose "Repo-local Git installation and $tarCommand already exist, skipping Git install."
}
else {
if (-not $GitVersion) {
$globalJson = Get-Content "$repoRoot\global.json" | ConvertFrom-Json
$GitVersion = $globalJson.tools.Git
}
$Uri = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/git/Git-${GitVersion}-64-bit.zip"
Import-Module -Name (Join-Path $PSScriptRoot "..\common\native\CommonLibrary.psm1" -Resolve)
$InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri -InstallDirectory "$installDir\" -Force:$Force -Verbose
if ($InstallStatus -Eq $False) {
Write-Error "Installation failed"
exit 1
}
}
New-Item "$repoRoot\.tools\" -ErrorAction SilentlyContinue -ItemType Directory
Copy-Item "$tarCommand" "$finalCommand" -Verbose
Write-Host "Tar now available at '$finalCommand'"
if ($tarCommand -like '*\Git\*') {
$null >.\.tools\tar.fromGit
}
......@@ -85,9 +85,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<LayoutTargetDir>$(TargetingPackLayoutRoot)$(TargetingPackSubPath)</LayoutTargetDir>
<LocalInstallationOutputPath>$(LocalDotNetRoot)$(TargetingPackSubPath)</LocalInstallationOutputPath>
<ArchiveOutputFileName>aspnetcore-targeting-pack-$(PackageVersion)</ArchiveOutputFileName>
<ZipArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName).zip</ZipArchiveOutputPath>
<TarArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName).tar.gz</TarArchiveOutputPath>
<ArchiveOutputFileName>aspnetcore-targeting-pack-$(PackageVersion)-$(TargetRuntimeIdentifier)</ArchiveOutputFileName>
<ArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName)$(ArchiveExtension)</ArchiveOutputPath>
</PropertyGroup>
<PropertyGroup>
......@@ -221,29 +220,17 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<Target Name="_CreateTargetingPackArchive"
Inputs="@(RefPackContent)"
Outputs="$(ZipArchiveOutputPath);$(TarArchiveOutputPath)"
Condition=" '$(IsPackable)' == 'true' ">
<PropertyGroup>
<_TarCommand>tar</_TarCommand>
<_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">"$(RepoRoot).tools\tar.exe"</_TarCommand>
<!-- For the tar packed with git, transform e.g. "C:\root\AspNetCore\File.tar.gz" to "/C/root/AspNetCore/File.tar.gz". -->
<_TarArchiveOutputPath>$(TarArchiveOutputPath)</_TarArchiveOutputPath>
<_TarArchiveOutputPath
Condition="Exists('$(repoRoot)\.tools\tar.fromGit')">/$(TarArchiveOutputPath.Replace('\','/').Replace(':',''))</_TarArchiveOutputPath>
</PropertyGroup>
Outputs="$(ArchiveOutputPath)">
<ZipDirectory
SourceDirectory="$(TargetingPackLayoutRoot)"
DestinationFile="$(ZipArchiveOutputPath)"
Overwrite="true" />
<!-- Requires Windows 10 version 1803 or newer -->
<Message Importance="High" Text="Executing: $(_TarCommand) -czf &quot;$(_TarArchiveOutputPath)&quot; ." />
<Exec Command="$(_TarCommand) -czf &quot;$(_TarArchiveOutputPath)&quot; ."
WorkingDirectory="$(TargetingPackLayoutRoot)" />
<Message Importance="High" Text="$(MSBuildProjectName) -> $(TarArchiveOutputPath)" />
DestinationFile="$(ArchiveOutputPath)"
Overwrite="true"
Condition="'$(ArchiveExtension)' == '.zip'" />
<Exec
Command="tar -czf $(ArchiveOutputPath) ."
WorkingDirectory="$(TargetingPackLayoutRoot)"
Condition="'$(ArchiveExtension)' == '.tar.gz'" />
<Message Importance="High" Text="$(MSBuildProjectName) -> $(ArchiveOutputPath)" />
</Target>
<Target Name="IncludeFrameworkListFile"
......
......@@ -37,7 +37,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<PropertyGroup>
<TargetFileName>$(TargetingPackInstallerBaseName)-$(TargetingPackVersion).deb</TargetFileName>
<TargetFileName>$(TargetingPackInstallerBaseName)-$(TargetingPackVersion)-$(TargetArchitecture).deb</TargetFileName>
<TargetPath>$(TargetDir)$(TargetFileName)</TargetPath>
<DebPackageVersion>$(TargetingPackVersionPrefix)</DebPackageVersion>
......
......@@ -66,7 +66,7 @@
<TargetingPackHarvestRoot Condition="'$(TargetingPackHarvestRoot)' == ''">$(InstallersOutputPath)</TargetingPackHarvestRoot>
<TargetingPackZipVersion>$(TargetingPackVersionPrefix)</TargetingPackZipVersion>
<TargetingPackZipVersion Condition="'$(VersionSuffix)' != ''">$(TargetingPackZipVersion)-$(VersionSuffix)</TargetingPackZipVersion>
<IntermediateTargetingPackZip>$(TargetingPackHarvestRoot)aspnetcore-targeting-pack-$(TargetingPackZipVersion).zip</IntermediateTargetingPackZip>
<IntermediateTargetingPackZip>$(TargetingPackHarvestRoot)aspnetcore-targeting-pack-$(TargetingPackZipVersion)-$(TargetRuntimeIdentifier).zip</IntermediateTargetingPackZip>
</PropertyGroup>
<Unzip SourceFiles="$(IntermediateTargetingPackZip)" DestinationFolder="$(HarvestSource)" />
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册