File tree Expand file tree Collapse file tree 2 files changed +35
-18
lines changed Expand file tree Collapse file tree 2 files changed +35
-18
lines changed Original file line number Diff line number Diff line change @@ -533,12 +533,7 @@ function Start-BuildPowerShellNativePackage
533
533
534
534
[Parameter (Mandatory = $true )]
535
535
[ValidateScript ({Test-Path $_ - PathType Leaf})]
536
- [string ] $psrpZipPath ,
537
-
538
- [Parameter (Mandatory = $true )]
539
- [string ] $NuGetOutputPath ,
540
-
541
- [switch ] $SkipCleanup = $false
536
+ [string ] $psrpZipPath
542
537
)
543
538
544
539
if (-not (Test-Path $PackageRoot ))
@@ -605,24 +600,32 @@ function Start-BuildPowerShellNativePackage
605
600
Copy-Item $iconPath (Join-Path $PackageRoot - ChildPath $iconFileName ) - Verbose
606
601
607
602
$Nuspec -f $Version , $iconFileName | Out-File - FilePath (Join-Path $PackageRoot - ChildPath ' Microsoft.PowerShell.Native.nuspec' ) - Force
603
+ }
608
604
609
- if (-not (Test-Path $NuGetOutputPath ))
610
- {
611
- $null = New-Item $NuGetOutputPath - Force - Verbose - ItemType Directory
612
- }
605
+ <#
606
+ . SYNOPSIS
607
+ Pack the new nuget package from af folder.
608
+ #>
609
+ function New-NugetPackage {
610
+ param (
611
+ [Parameter (Mandatory )]
612
+ [string ] $PackageRoot ,
613
+
614
+ [Parameter (Mandatory )]
615
+ [string ] $NuGetOutputPath
616
+ )
613
617
614
618
try {
619
+ if (-not (Test-Path $NuGetOutputPath )) {
620
+ $null = New-Item $NuGetOutputPath - Force - Verbose - ItemType Directory
621
+ }
622
+
615
623
Push-Location $PackageRoot
616
624
nuget.exe pack . - OutputDirectory $NuGetOutputPath
617
625
}
618
626
finally {
619
627
Pop-Location
620
628
}
621
-
622
- if (-not $SkipCleanup -and (Test-Path $tempExtractionPath ))
623
- {
624
- Remove-Item $tempExtractionPath - Recurse - Force - ErrorAction SilentlyContinue
625
- }
626
629
}
627
630
628
631
<#
Original file line number Diff line number Diff line change @@ -82,9 +82,23 @@ steps:
82
82
$macOSZipPath = Join-Path "$(System.ArtifactsDirectory)/release" 'osx-symbols.zip'
83
83
$psrpZipPath = Join-Path "$(System.ArtifactsDirectory)/release" 'psrp.zip'
84
84
85
- Start-BuildPowerShellNativePackage -PackageRoot $PackageRoot -Version $(PackageVersion) -WindowsX64ZipPath $WindowsX64ZipPath -WindowsX86ZipPath $WindowsX86ZipPath -WindowsARMZipPath $WindowsARMZipPath -WindowsARM64ZipPath $WindowsARM64ZipPath -LinuxZipPath $LinuxZipPath -LinuxARMZipPath $LinuxARMZipPath -LinuxARM64ZipPath $LinuxARM64ZipPath -LinuxAlpineZipPath $LinuxAlpineZipPath -macOSZipPath $macOSZipPath -psrpZipPath $psrpZipPath -NuGetOutputPath $(NuGetPackagePath)
86
-
87
- displayName : ' Build NuGet package'
85
+ Start-BuildPowerShellNativePackage -PackageRoot $PackageRoot -Version $(PackageVersion) -WindowsX64ZipPath $WindowsX64ZipPath -WindowsX86ZipPath $WindowsX86ZipPath -WindowsARMZipPath $WindowsARMZipPath -WindowsARM64ZipPath $WindowsARM64ZipPath -LinuxZipPath $LinuxZipPath -LinuxARMZipPath $LinuxARMZipPath -LinuxARM64ZipPath $LinuxARM64ZipPath -LinuxAlpineZipPath $LinuxAlpineZipPath -macOSZipPath $macOSZipPath -psrpZipPath $psrpZipPath
86
+
87
+ displayName : ' Collate NuGet package structure'
88
+
89
+ - ${{ if ne(variables['SkipSigning'], 'True') }} :
90
+ - template : Sbom.yml@ComplianceRepo
91
+ parameters :
92
+ BuildDropPath : ' $(System.ArtifactsDirectory)\NugetPackage'
93
+ Build_Repository_Uri : https://github.com/PowerShell/PowerShell-Native
94
+ PackageName : Microsoft.PowerShell.Native
95
+ PackageVersion : $(PackageVersion)
96
+
97
+ - pwsh : |
98
+ Import-Module $(Build.SourcesDirectory)\build.psm1
99
+ $PackageRoot = "$(System.ArtifactsDirectory)\NugetPackage"
100
+ New-NugetPackage -PackageRoot $PackageRoot -NuGetOutputPath $(NuGetPackagePath)
101
+ displayName : Build NuGet package
88
102
89
103
- powershell : ' Get-Childitem $(NuGetPackagePath)'
90
104
displayName : ' Capture nuget package'
You can’t perform that action at this time.
0 commit comments