1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-11 02:13:38 +09:00
Satori/eng/common/sdl/extract-artifact-archives.ps1
dotnet-maestro[bot] e983168f87
[main] Update dependencies from 8 repositories (#55636)
* Update dependencies from https://github.com/dotnet/arcade build 20210713.2

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21359.3 -> To Version 6.0.0-beta.21363.2

* Update dependencies from https://github.com/dotnet/icu build 20210713.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-preview.7.21362.1 -> To Version 6.0.0-preview.7.21363.1

* Update dependencies from https://github.com/dotnet/xharness build 20210713.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21357.4 -> To Version 1.0.0-prerelease.21363.1

* Update dependencies from https://github.com/mono/linker build 20210713.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21362.3 -> To Version 6.0.100-preview.6.21363.1

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20210712.2

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 6.0.0-rc1.21356.1 -> To Version 6.0.0-rc1.21362.2

* Update dependencies from https://github.com/dotnet/emsdk build 20210714.1

Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
 From Version 6.0.0-preview.7.21363.1 -> To Version 6.0.0-preview.7.21364.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20210714.4

optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.21362.2 -> To Version 1.0.0-prerelease.21364.4

* Update dependencies from https://github.com/dotnet/arcade build 20210714.3

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21359.3 -> To Version 6.0.0-beta.21364.3

* Update dependencies from https://github.com/dotnet/xharness build 20210714.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21357.4 -> To Version 1.0.0-prerelease.21364.1

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20210714.1

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.1-alpha.0.21362.1 -> To Version 1.0.1-alpha.0.21364.1

* Revert linker change

* Roll back the version

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Andy Gocke <angocke@microsoft.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
2021-07-15 15:27:46 -07:00

63 lines
2.3 KiB
PowerShell

# This script looks for each archive file in a directory and extracts it into the target directory.
# For example, the file "$InputPath/bin.tar.gz" extracts to "$ExtractPath/bin.tar.gz.extracted/**".
# Uses the "tar" utility added to Windows 10 / Windows 2019 that supports tar.gz and zip.
param(
# Full path to directory where archives are stored.
[Parameter(Mandatory=$true)][string] $InputPath,
# Full path to directory to extract archives into. May be the same as $InputPath.
[Parameter(Mandatory=$true)][string] $ExtractPath
)
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 2.0
$disableConfigureToolsetImport = $true
try {
# `tools.ps1` checks $ci to perform some actions. Since the SDL
# scripts don't necessarily execute in the same agent that run the
# build.ps1/sh script this variable isn't automatically set.
$ci = $true
. $PSScriptRoot\..\tools.ps1
Measure-Command {
$jobs = @()
# Find archive files for non-Windows and Windows builds.
$archiveFiles = @(
Get-ChildItem (Join-Path $InputPath "*.tar.gz")
Get-ChildItem (Join-Path $InputPath "*.zip")
)
foreach ($targzFile in $archiveFiles) {
$jobs += Start-Job -ScriptBlock {
$file = $using:targzFile
$fileName = [System.IO.Path]::GetFileName($file)
$extractDir = Join-Path $using:ExtractPath "$fileName.extracted"
New-Item $extractDir -ItemType Directory -Force | Out-Null
Write-Host "Extracting '$file' to '$extractDir'..."
# Pipe errors to stdout to prevent PowerShell detecting them and quitting the job early.
# This type of quit skips the catch, so we wouldn't be able to tell which file triggered the
# error. Save output so it can be stored in the exception string along with context.
$output = tar -xf $file -C $extractDir 2>&1
# Handle NZEC manually rather than using Exit-IfNZEC: we are in a background job, so we
# don't have access to the outer scope.
if ($LASTEXITCODE -ne 0) {
throw "Error extracting '$file': non-zero exit code ($LASTEXITCODE). Output: '$output'"
}
Write-Host "Extracted to $extractDir"
}
}
Receive-Job $jobs -Wait
}
}
catch {
Write-Host $_
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_
ExitWithExitCode 1
}