10000 Package only from the powershell folder at the root directory (#4569) · PowerShell/PowerShell@0ca44f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ca44f1

Browse files
TravisEz13daxian-dbw
authored andcommitted
Package only from the powershell folder at the root directory (#4569)
1 parent 498680a commit 0ca44f1

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

build.psm1

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,23 @@ function New-PSOptions {
723723
$Top = [IO.Path]::Combine($PSScriptRoot, "src", "System.Management.Automation")
724724
}
725725

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;
727743
Configuration = $Configuration;
728744
Framework = $Framework;
729745
Runtime = $Runtime;

tools/appveyor.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ function Invoke-AppveyorFinish
448448
}
449449

450450
# Build packages
451-
$packages = Start-PSPackage @packageParams
451+
$packages = Start-PSPackage @packageParams -SkipReleaseChecks
452452

453453
$name = Get-PackageName
454454

tools/packaging/packaging.psm1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ function Start-PSPackage {
2929

3030
[Switch] $Force,
3131

32-
[Switch] $IncludeSymbols
32+
[Switch] $IncludeSymbols,
33+
34+
[Switch] $SkipReleaseChecks
3335
)
3436

3537
# Runtime and Configuration settings required by the package
@@ -81,6 +83,13 @@ function Start-PSPackage {
8183
throw "Please ensure you have run 'Start-PSBuild $params'!"
8284
}
8385

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+
8493
# If ReleaseTag is specified, use the given tag to calculate Vesrion
8594
if ($PSCmdlet.ParameterSetName -eq "ReleaseTag") {
8695
$Version = $ReleaseTag -Replace '^v'

tools/travis.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,9 @@ else
179179
$packageParams += @{Version=$version}
180180
}
181181
# 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
184185
foreach($package in $packages)
185186
{
186187
# Publish the packages to the nuget feed if:

0 commit comments

Comments
 (0)
0