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

Use only tar to create tar.gz archive #691

Merged
merged 1 commit into from
Mar 13, 2025
Merged
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
19 changes: 10 additions & 9 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -716,20 +716,21 @@ if ($packageType -eq 'msixbundle') {
$architecture
}

$packageName = "DSC-$productVersion-$productArchitecture.tar"
Write-Verbose -Verbose "Creating tar.gz file"
$packageName = "DSC-$productVersion-$productArchitecture.tar.gz"
$tarFile = Join-Path $PSScriptRoot 'bin' $packageName
tar cvf $tarFile -C $tgzTarget .
tar -czvf $tarFile -C $tgzTarget .
if ($LASTEXITCODE -ne 0) {
throw "Failed to create tar file"
throw "Failed to create tar.gz file"
}
Write-Host -ForegroundColor Green "`nTar file is created at $tarFile"

$gzFile = "$tarFile.gz"
gzip -c $tarFile > $gzFile
if ($LASTEXITCODE -ne 0) {
throw "Failed to create gz file"
# check it's valid
$out = file $tarFile
if ($out -notmatch 'gzip compressed data') {
throw "Invalid tar.gz file"
}
Write-Host -ForegroundColor Green "`nGz file is created at $gzFile"

Write-Host -ForegroundColor Green "`ntar.gz file is created at $tarFile"
}

$env:RUST_BACKTRACE=1