mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Support creating tarball package for Linux and macOS (#5085)
* Support creating tarball package for Linux and macOS * Address comments
This commit is contained in:
1 parent
94a71b05d4
commit
a391998a25
4 files changed
+108
-36
No files matched your search
@@ -11,11 +11,13 @@ param (
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+\.\d+)?$")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$ReleaseTag,
|
||||
[switch]$AppImage
|
||||
|
||||
[ValidateSet("AppImage", "tar")]
|
||||
[string[]]$ExtraPackage
|
||||
)
|
||||
|
||||
$releaseTagParam = @{}
|
||||
if($ReleaseTag)
|
||||
if ($ReleaseTag)
|
||||
{
|
||||
$releaseTagParam = @{ 'ReleaseTag' = $ReleaseTag }
|
||||
}
|
||||
@@ -25,14 +27,15 @@ try {
|
||||
Set-Location $location
|
||||
Import-Module "$location/build.psm1"
|
||||
Import-Module "$location/tools/packaging"
|
||||
|
||||
|
||||
Start-PSBootstrap -Package -NoSudo
|
||||
Start-PSBuild -Crossgen -PSModuleRestore @releaseTagParam
|
||||
|
||||
Start-PSPackage @releaseTagParam
|
||||
if($AppImage.IsPresent)
|
||||
switch ($ExtraPackage)
|
||||
{
|
||||
Start-PSPackage -Type AppImage @releaseTagParam
|
||||
"AppImage" { Start-PSPackage -Type AppImage @releaseTagParam }
|
||||
"tar" { Start-PSPackage -Type tar @releaseTagParam }
|
||||
}
|
||||
}
|
||||
finally
|
||||
@@ -40,18 +43,10 @@ finally
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
$linuxPackages = Get-ChildItem "$location/powershell*" -Include *.deb,*.rpm
|
||||
|
||||
foreach($linuxPackage in $linuxPackages)
|
||||
{
|
||||
Copy-Item -Path $linuxPackage.FullName -Destination $destination -force
|
||||
}
|
||||
|
||||
if($AppImage.IsPresent)
|
||||
$linuxPackages = Get-ChildItem "$location/powershell*" -Include *.deb,*.rpm,*.AppImage,*.tar.gz
|
||||
foreach ($linuxPackage in $linuxPackages)
|
||||
{
|
||||
$appImages = Get-ChildItem -Path $location -Filter '*.AppImage'
|
||||
foreach($appImageFile in $appImages)
|
||||
{
|
||||
Copy-Item -Path $appImageFile.FullName -Destination $destination -force
|
||||
}
|
||||
$filePath = $linuxPackage.FullName
|
||||
Write-Verbose "Copying $filePath to $destination" -Verbose
|
||||
Copy-Item -Path $filePath -Destination $destination -force
|
||||
}
|
||||
Reference in new issue
Block a user