8000 Creates a single package for Windows by adityapatwardhan · Pull Request #4540 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Creates a single package for Windows #4540

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 6 commits into from
Aug 28, 2017
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
17 changes: 6 additions & 11 deletions docs/maintainers/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,15 @@ On Windows, the `-Runtime` parameter should be specified for `Start-PSBuild` to
# Install dependencies
Start-PSBootstrap -Package

# Build for v6.0.0-beta.1 release targeting Windows 10 and Server 2016
Start-PSBuild -Clean -CrossGen -PSModuleRestore -Runtime win10-x64 -Configuration Release -ReleaseTag v6.0.0-beta.1
# Build for v6.0.0-beta.1 release targeting Windows universal package, set -Runtime to win7-x64
Start-PSBuild -Clean -CrossGen -PSModuleRestore -Runtime win7-x64 -Configuration Release -ReleaseTag v6.0.0-beta.1
```

If the package is targeting a downlevel Windows (not Windows 10 or Server 2016),
the `-WindowsDownLevel` parameter should be specified for `Start-PSPackage`.
Otherwise, the `-WindowsDownLevel` parameter should be left out.

```powershell
# Create packages for v6.0.0-beta.1 release targeting Windows 10 and Server 2016.
# When creating packages for downlevel Windows, such as Windows 8.1 or Server 2012R2,
# the parameter '-WindowsDownLevel' must be specified.
Start-PSPackage -Type msi -ReleaseTag v6.0.0-beta.1 <# -WindowsDownLevel win81-x64 #>
Start-PSPackage -Type zip -ReleaseTag v6.0.0-beta.1 <# -WindowsDownLevel win81-x64 #>
# Create packages for v6.0.0-beta.1 release targeting Windows universal package.
# 'win7-x64' / 'win7-x86' should be used for -WindowsRuntime.
Start-PSPackage -Type msi -ReleaseTag v6.0.0-beta.1 -WindowsRuntime 'win7-x64'
Start-PSPackage -Type zip -ReleaseTag v6.0.0-beta.1 -WindowsRuntime 'win7-x64'
```

## NuGet Packages
Expand Down
28 changes: 13 additions & 15 deletions tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ function Start-PSPackage {
[string[]]$Type,

# Generate windows downlevel package
[ValidateSet("win81-x64", "win7-x86", "win7-x64")]
[ValidateSet("win7-x86", "win7-x64")]
[ValidateScript({$Environment.IsWindows})]
[string]$WindowsDownLevel,
[string]$WindowsRuntime,

[Switch] $Force,

Expand All @@ -35,11 +35,20 @@ function Start-PSPackage {
)

# Runtime and Configuration settings required by the package
($Runtime, $Configuration) = if ($WindowsDownLevel) {
$WindowsDownLevel, "Release"
($Runtime, $Configuration) = if ($WindowsRuntime) {
$WindowsRuntime, "Release"
} else {
New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration }
}

# We convert the runtime to win7-x64 or win7-x86 to build the universal windows package.
if($Environment.IsWindows) {
$Runtime = $Runtime -replace "win\d+", "win7"

# Build the name suffix for win-plat packages
$NameSuffix = $Runtime -replace 'win\d+', 'win'
}

log "Packaging RID: '$Runtime'; Packaging Configuration: '$Configuration'"

$Script:Options = Get-PSOptions
Expand Down Expand Up @@ -119,17 +128,6 @@ function Start-PSPackage {
}
log "Packaging Type: $Type"

# Build the name suffix for win-plat packages
if ($Environment.IsWindows) {
# Add the server name to the $RunTime. $runtime produced by dotnet is same for client or server
switch ($Runtime) {
'win81-x64' {$NameSuffix = 'win81-win2012r2-x64'}
'win10-x64' {$NameSuffix = 'win10-win2016-x64'}
'win7-x64' {$NameSuffix = 'win7-win2008r2-x64'}
Default {$NameSuffix = $Runtime}
}
}

# Add the symbols to the suffix
# if symbols are specified to be included
if($IncludeSymbols.IsPresent -and $NameSuffix) {
Expand Down
0