Switch packages for Ubuntu & macOS to use tar.gz format instead of zip #6

Merged
maxim-lobanov merged 7 commits from v-malob/switch-to-tar-gz into master 2020-04-23 20:42:49 +05:00
3 changed files with 10 additions and 6 deletions
Showing only changes of commit 7e2965c731 - Show all commits

View File

@@ -25,7 +25,7 @@ jobs:
- task: ExtractFiles@1 - task: ExtractFiles@1
inputs: inputs:
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/node-$(Version)-$(Platform)-$(Architecture).zip' archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/node-$(Version)-$(Platform)-$(Architecture).*'
destinationFolder: $(Build.BinariesDirectory) destinationFolder: $(Build.BinariesDirectory)
cleanDestinationFolder: false cleanDestinationFolder: false

View File

@@ -23,7 +23,8 @@ function Create-TarArchive {
[string]$CompressionType = "gz" [string]$CompressionType = "gz"
) )
$CompressionArgument = If ([string]::IsNullOrWhiteSpace($CompressionType)) { "" } else { "--${CompressionType}" } $CompressionTypeArgument = If ([string]::IsNullOrWhiteSpace($CompressionType)) { "" } else { "--${CompressionType}" }
tar -c $CompressionArgument -f $ArchivePath "$SourceFolder/*.*" Write-Debug "tar -c $CompressionTypeArgument -f $ArchivePath $SourceFolder"
tar -c $CompressionTypeArgument -f $ArchivePath $SourceFolder
} }

View File

@@ -20,12 +20,15 @@ function Create-SevenZipArchive {
[String]$SourceFolder, [String]$SourceFolder,
[Parameter(Mandatory=$true)] [Parameter(Mandatory=$true)]
[String]$ArchivePath, [String]$ArchivePath,
[String]$ArchiveType = "zip" [String]$ArchiveType = "zip",
[String]$CompressionLevel = 5
) )
$ArchiveTypeArgument = "-t${ArchiveType}" $ArchiveTypeArgument = "-t${ArchiveType}"
$CompressionLevelArgument = "-mx=${CompressionLevel}"
Push-Location $SourceFolder Push-Location $SourceFolder
7z a $ArchiveTypeArgument $ArchivePath *.* -r Write-Debug "7z a $ArchiveTypeArgument $CompressionLevelArgument $ArchivePath @$SourceFolder"
7z a $ArchiveTypeArgument $CompressionLevelArgument $ArchivePath @$SourceFolder
Pop-Location Pop-Location
} }