8000 Package only from root plus powershell by TravisEz13 · Pull Request #4569 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Package only from root plus powershell #4569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,23 @@ function New-PSOptions {
$Top = [IO.Path]::Combine($PSScriptRoot, "src", "System.Management.Automation")
}

return @{ Top = $Top;
$RootInfo = @{RepoPath = $PSScriptRoot}

# the valid root is the root of the filesystem and the folder PowerShell
$RootInfo['ValidPath'] = Join-Path -Path ([system.io.path]::GetPathRoot($RootInfo.RepoPath)) -ChildPath 'PowerShell'

if($RepoInfo.RepoPath -ne $RootInfo.ValidPath)
{
$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!"
$RootInfo['IsValid'] = $false
}
else
{
$RootInfo['IsValid'] = $true
}

return @{ RootInfo = [PSCustomObject]$RootInfo
Top = $Top;
Configuration = $Configuration;
Framework = $Framework;
Runtime = $Runtime;
Expand Down
2 changes: 1 addition & 1 deletion tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ function Invoke-AppveyorFinish
}

# Build packages
$packages = Start-PSPackage @packageParams
$packages = Start-PSPackage @packageParams -SkipReleaseChecks

$name = Get-PackageName

Expand Down
11 changes: 10 additions & 1 deletion tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ function Start-PSPackage {

[Switch] $Force,

[Switch] $IncludeSymbols
[Switch] $IncludeSymbols,

[Switch] $SkipReleaseChecks
)

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

if($SkipReleaseChecks.IsPresent) {
Write-Warning "Skipping release checks."
}
elseif(!$Script:Options.RootInfo.IsValid){
throw $Script:Options.RootInfo.Warning
}

# If ReleaseTag is specified, use the given tag to calculate Vesrion
if ($PSCmdlet.ParameterSetName -eq "ReleaseTag") {
$Version = $ReleaseTag -Replace '^v'
Expand Down
5 changes: 3 additions & 2 deletions tools/travis.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ else
$packageParams += @{Version=$version}
}
# Only build packages for branches, not pull requests
$packages = @(Start-PSPackage @packageParams)
$packages += Start-PSPackage @packageParams -Type AppImage
$packages = @(Start-PSPackage @packageParams -SkipReleaseChecks)
# Packaging AppImage depends on the deb package
$packages += Start-PSPackage @packageParams -Type AppImage -SkipReleaseChecks
foreach($package in $packages)
{
# Publish the packages to the nuget feed if:
Expand Down
0