File tree Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -723,7 +723,23 @@ function New-PSOptions {
723
723
$Top = [IO.Path ]::Combine($PSScriptRoot , " src" , " System.Management.Automation" )
724
724
}
725
725
726
- return @ { Top = $Top ;
726
+ $RootInfo = @ {RepoPath = $PSScriptRoot }
727
+
728
+ # the valid root is the root of the filesystem and the folder PowerShell
729
+ $RootInfo [' ValidPath' ] = Join-Path - Path ([system.io.path ]::GetPathRoot($RootInfo.RepoPath )) - ChildPath ' PowerShell'
730
+
731
+ if ($RepoInfo.RepoPath -ne $RootInfo.ValidPath )
732
+ {
733
+ $RootInfo [' Warning' ] = " Please ensure you repo is at the root of the file system and named 'PowerShell' (example: '$ ( $RootInfo.ValidPath ) '), when building and packaging for release!"
734
+ $RootInfo [' IsValid' ] = $false
735
+ }
736
+ else
737
+ {
738
+ $RootInfo [' IsValid' ] = $true
739
+ }
740
+
741
+ return @ { RootInfo = [PSCustomObject ]$RootInfo
742
+ Top = $Top ;
727
743
Configuration = $Configuration ;
728
744
Framework = $Framework ;
729
745
Runtime = $Runtime ;
Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ function Invoke-AppveyorFinish
448
448
}
449
449
450
450
# Build packages
451
- $packages = Start-PSPackage @packageParams
451
+ $packages = Start-PSPackage @packageParams - SkipReleaseChecks
452
452
453
453
$name = Get-PackageName
454
454
Original file line number Diff line number Diff line change @@ -29,7 +29,9 @@ function Start-PSPackage {
29
29
30
30
[Switch ] $Force ,
31
31
32
- [Switch ] $IncludeSymbols
32
+ [Switch ] $IncludeSymbols ,
33
+
34
+ [Switch ] $SkipReleaseChecks
33
35
)
34
36
35
37
# Runtime and Configuration settings required by the package
@@ -81,6 +83,13 @@ function Start-PSPackage {
81
83
throw " Please ensure you have run 'Start-PSBuild $params '!"
82
84
}
83
85
86
+ if ($SkipReleaseChecks.IsPresent ) {
87
+ Write-Warning " Skipping release checks."
88
+ }
89
+ elseif (! $Script :Options.RootInfo.IsValid ){
90
+ throw $Script :Options.RootInfo.Warning
91
+ }
92
+
84
93
# If ReleaseTag is specified, use the given tag to calculate Vesrion
85
94
if ($PSCmdlet.ParameterSetName -eq " ReleaseTag" ) {
86
95
$Version = $ReleaseTag -Replace ' ^v'
Original file line number Diff line number Diff line change 179
179
$packageParams += @ {Version = $version }
180
180
}
181
181
# Only build packages for branches, not pull requests
182
- $packages = @ (Start-PSPackage @packageParams )
183
- $packages += Start-PSPackage @packageParams - Type AppImage
182
+ $packages = @ (Start-PSPackage @packageParams - SkipReleaseChecks)
183
+ # Packaging AppImage depends on the deb package
184
+ $packages += Start-PSPackage @packageParams - Type AppImage - SkipReleaseChecks
184
185
foreach ($package in $packages )
185
186
{
186
187
# Publish the packages to the nuget feed if:
You can’t perform that action at this time.
0 commit comments