Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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
16 changes: 4 additions & 12 deletions 16 .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ To run the link-checker, follow these steps:
1. Issues marked as [`First-Time-Issue`][first-time-issue],
are identified as being easy and a great way to learn about this project and making
contributions.

### Finding or creating an issue

1. Follow the instructions in [Contributing to Issues][contribute-issues] to find or open an issue.
Expand Down Expand Up @@ -264,18 +264,10 @@ Please see PowerShell [Testing Guidelines - Running Tests Outside of CI][running
* Our CI contains automated spell checking and link checking for Markdown files. If there is any false-positive,
[run the spell checker command-line tool in interactive mode](#spell-checking-documentation)
to add words to the `.spelling` file.
* Our packaging test may not pass and ask you to update `files.wxs` file if you add/remove/update nuget package references or add/remove assert files.

You could update the file manually in accordance with messages in the test log file. Or you can use automatically generated file. To get the file you should build the msi package locally:

```powershell
Import-Module .\build.psm1
Start-PSBuild -Clean -CrossGen -PSModuleRestore -Runtime win7-x64 -Configuration Release -ReleaseTag <release tag>
Import-Module .\tools\packaging
Start-PSPackage -Type msi -ReleaseTag <release tag> -WindowsRuntime 'win7-x64' -SkipReleaseChecks
```

Last command will report where new file is located.
You could update the `.spelling` file manually in accordance with messages in the test log file, or
[run the spell checker command-line tool in interactive mode](#spell-checking-documentation)
to add the false-positive words directly.

#### Pull Request - Workflow

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ PowerShell code in GitHub Actions YAML files should be kept minimal. Move code t

**Examples**:
- `Start-PSPackage` - Create packages
- `New-MSIPackage` - Create Windows MSI
- `New-MSIXPackage` - Create Windows MSIX
- `New-DotnetSdkContainerFxdPackage` - Create container packages

**When NOT to use**:
Expand Down
19 changes: 6 additions & 13 deletions 19 .pipelines/templates/packaging/windows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ jobs:
}

$packageTypes = switch ($runtime) {
'x64' { @('msi', 'zip', 'msix') }
'x86' { @('msi', 'zip', 'msix') }
'arm64' { @('msi', 'zip', 'msix') }
'x64' { @('zip', 'msix') }
'x86' { @('zip', 'msix') }
'arm64' { @('zip', 'msix') }
'fxdependent' { 'fxdependent' }
'fxdependentWinDesktop' { 'fxdependent-win-desktop' }
'minsize' { 'min-size' }
Expand Down Expand Up @@ -193,9 +193,9 @@ jobs:
Write-Verbose -Verbose "runtime = '$(Runtime)'"

$packageTypes = switch ($runtime) {
'x64' { @('msi', 'zip', 'msix') }
'x86' { @('msi', 'zip', 'msix') }
'arm64' { @('msi', 'zip', 'msix') }
'x64' { @('zip', 'msix') }
'x86' { @('zip', 'msix') }
'arm64' { @('zip', 'msix') }
'fxdependent' { 'fxdependent' }
'fxdependentWinDesktop' { 'fxdependent-win-desktop' }
'minsize' { 'min-size' }
Expand All @@ -205,13 +205,6 @@ jobs:
New-Item -ItemType Directory -Path $(ob_outputDirectory) -Force
}

if ($packageTypes -contains 'msi') {
$msiPkgNameFilter = "powershell-*.msi"
$msiPkgPath = Get-ChildItem -Path $(Pipeline.Workspace) -Filter $msiPkgNameFilter -Recurse -File | Select-Object -ExpandProperty FullName
Write-Verbose -Verbose "unsigned msiPkgPath: $msiPkgPath"
Copy-Item -Path $msiPkgPath -Destination '$(ob_outputDirectory)' -Force -Verbose
}

if ($packageTypes -contains 'zip' -or $packageTypes -contains 'fxdependent' -or $packageTypes -contains 'min-size' -or $packageTypes -contains 'fxdependent-win-desktop') {
$zipPkgNameFilter = "powershell-*.zip"
$zipPkgPath = Get-ChildItem -Path $(Pipeline.Workspace) -Filter $zipPkgNameFilter -Recurse -File | Select-Object -ExpandProperty FullName
Expand Down
109 changes: 5 additions & 104 deletions 109 .pipelines/templates/packaging/windows/sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,110 +67,25 @@ jobs:

- template: /.pipelines/templates/install-dotnet.yml@self

# Import build.psm1 and bootstrap packaging dependencies (WiX Toolset)
# Import build.psm1 and bootstrap packaging dependencies
- pwsh: |
$repoRoot = "$env:REPOROOT"
Import-Module "$repoRoot\build.psm1"
Import-Module "$repoRoot\tools\packaging"
Write-Verbose -Verbose "Modules imported successfully"

# Install WiX Toolset for EXE package creation
$isArm64 = '$(Runtime)' -eq 'arm64'
$env:RUNTIME = '$(Runtime)'
Start-PSBootstrap -Scenario Package
displayName: 'Import modules and install WiX Toolset'
displayName: 'Import modules'
env:
ob_restore_phase: true

# Sign MSI packages
- task: onebranch.pipeline.signing@1
displayName: Sign MSI packages
inputs:
command: 'sign'
signing_profile: external_distribution
files_to_sign: '**\*.msi'
search_root: '$(Pipeline.Workspace)'

# Create EXE package from signed MSI (for x64, x86, arm64 only)
- pwsh: |
$runtime = '$(Runtime)'
Write-Verbose -Verbose "runtime = '$(Runtime)'"

$repoRoot = "$env:REPOROOT"
Import-Module "$repoRoot\build.psm1"
Import-Module "$repoRoot\tools\packaging"

$noExeRuntimes = @('fxdependent', 'fxdependentWinDesktop', 'minsize')

if ($runtime -in $noExeRuntimes) {
Write-Verbose -Verbose "No EXE generated for $runtime"
return
}

$version = '$(Version)'

$msiLocation = Get-ChildItem -Path $(Pipeline.Workspace) -Recurse -Filter "powershell-*$runtime.msi" | Select-Object -ExpandProperty FullName
Write-Verbose -Verbose "msiLocation: $msiLocation"

Set-Location $repoRoot

$exePath = New-ExePackage -ProductVersion $version -ProductTargetArchitecture $runtime -MsiLocationPath $msiLocation
Write-Verbose -Verbose "setting vso[task.setvariable variable=exePath]$exePath"
Write-Host "##vso[task.setvariable variable=exePath]$exePath"
Write-Verbose -Verbose "exePath: $exePath"

$enginePath = Join-Path -Path '$(System.ArtifactsDirectory)\unsignedEngine' -ChildPath engine.exe
Expand-ExePackageEngine -ExePath $exePath -EnginePath $enginePath -ProductTargetArchitecture $runtime
displayName: 'Make exe and expand package'

# Sign EXE engine
- task: onebranch.pipeline.signing@1
displayName: Sign exe engine
inputs:
command: 'sign'
signing_profile: $(msft_3rd_party_cert_id)
files_to_sign: '$(System.ArtifactsDirectory)\unsignedEngine\*.exe'
search_root: '$(Pipeline.Workspace)'

# Compress signed EXE engine back into package
- pwsh: |
$runtime = '$(Runtime)'
Write-Verbose -Verbose "runtime = '$(Runtime)'"
$repoRoot = "$env:REPOROOT"
Import-Module "$repoRoot\build.psm1"
Import-Module "$repoRoot\tools\packaging"

$noExeRuntimes = @('fxdependent', 'fxdependentWinDesktop', 'minsize')

if ($runtime -in $noExeRuntimes) {
Write-Verbose -Verbose "No EXE generated for $runtime"
return
}

$exePath = '$(exePath)'
$enginePath = Join-Path -Path '$(System.ArtifactsDirectory)\unsignedEngine' -ChildPath engine.exe
$enginePath | Get-AuthenticodeSignature | out-string | Write-Verbose -verbose
Compress-ExePackageEngine -ExePath $exePath -EnginePath $enginePath -ProductTargetArchitecture $runtime
displayName: Compress signed exe package

# Sign final EXE packages
- task: onebranch.pipeline.signing@1
displayName: Sign exe packages
inputs:
command: 'sign'
signing_profile: external_distribution
files_to_sign: '**\*.exe'
search_root: '$(Pipeline.Workspace)'

# Copy all signed packages to output directory
- pwsh: |
$runtime = '$(Runtime)'
Write-Verbose -Verbose "runtime = '$(Runtime)'"

$packageTypes = switch ($runtime) {
'x64' { @('msi', 'zip', 'msix', 'exe') }
'x86' { @('msi', 'zip', 'msix', 'exe') }
'arm64' { @('msi', 'zip', 'msix', 'exe') }
'x64' { @('zip', 'msix') }
'x86' { @('zip', 'msix') }
'arm64' { @('zip', 'msix') }
'fxdependent' { 'fxdependent' }
'fxdependentWinDesktop' { 'fxdependent-win-desktop' }
'minsize' { 'min-size' }
Expand All @@ -180,20 +95,6 @@ jobs:
New-Item -ItemType Directory -Path $(ob_outputDirectory) -Force
}

if ($packageTypes -contains 'msi') {
$msiPkgNameFilter = "powershell-*.msi"
$msiPkgPath = Get-ChildItem -Path $(Pipeline.Workspace) -Filter $msiPkgNameFilter -Recurse -File | Select-Object -ExpandProperty FullName
Write-Verbose -Verbose "signed msiPkgPath: $msiPkgPath"
Copy-Item -Path $msiPkgPath -Destination '$(ob_outputDirectory)' -Force -Verbose
}

if ($packageTypes -contains 'exe') {
$exePkgNameFilter = "powershell-*.exe"
$exePkgPath = Get-ChildItem -Path $(Pipeline.Workspace) -Filter $exePkgNameFilter -Recurse -File | Select-Object -ExpandProperty FullName
Write-Verbose -Verbose "signed exePkgPath: $exePkgPath"
Copy-Item -Path $exePkgPath -Destination '$(ob_outputDirectory)' -Force -Verbose
}

if ($packageTypes -contains 'zip' -or $packageTypes -contains 'fxdependent' -or $packageTypes -contains 'min-size' -or $packageTypes -contains 'fxdependent-win-desktop') {
$zipPkgNameFilter = "powershell-*.zip"
$zipPkgPath = Get-ChildItem -Path $(Pipeline.Workspace) -Filter $zipPkgNameFilter -Recurse -File | Select-Object -ExpandProperty FullName
Expand Down
7 changes: 7 additions & 0 deletions 7 .pipelines/templates/release-githubNuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ jobs:
$exefiles | Remove-Item -Force -Verbose
}

# The .msi packages should not be uploaded to GitHub release.
$msifiles = Get-ChildItem -Path $Path -Filter *.msi
if ($msifiles) {
Write-Verbose -Verbose "Remove .msi packages:"
$msifiles | Remove-Item -Force -Verbose
}

$OutputPath = Join-Path $Path 'hashes.sha256'
$packages = Get-ChildItem -Path $Path -Include * -Recurse -File
$checksums = $packages |
Expand Down
6 changes: 3 additions & 3 deletions 6 .pipelines/templates/release-validate-packagenames.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ jobs:

- pwsh: |
$message = @()
Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -include *.zip, *.msi | ForEach-Object {
if($_.Name -notmatch 'PowerShell-\d+\.\d+\.\d+\-([a-z]*.\d+\-)?win\-(fxdependent|x64|arm64|x86|fxdependentWinDesktop)\.(msi|zip){1}')
Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -include *.zip | ForEach-Object {
if($_.Name -notmatch 'PowerShell-\d+\.\d+\.\d+\-([a-z]*.\d+\-)?win\-(fxdependent|x64|arm64|x86|fxdependentWinDesktop)\.(zip){1}')
{
$messageInstance = "$($_.Name) is not a valid package name"
$message += $messageInstance
Expand All @@ -104,7 +104,7 @@ jobs:
}

if($message.count -gt 0){throw ($message | out-string)}
displayName: Validate Zip and MSI Package Names
displayName: Validate Zip Package Names

- pwsh: |
$message = @()
Expand Down
20 changes: 7 additions & 13 deletions 20 .pipelines/templates/uploadToAzure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,8 @@ jobs:
buildType: 'current'
artifact: drop_windows_package_package_win_arm64
itemPattern: |
**/*.msi
**/*.msix
**/*.zip
**/*.exe
targetPath: '$(Build.ArtifactStagingDirectory)/downloads'
displayName: Download windows arm64 packages

Expand Down Expand Up @@ -185,10 +183,8 @@ jobs:
buildType: 'current'
artifact: drop_windows_package_package_win_x64
itemPattern: |
**/*.msi
**/*.msix
**/*.zip
**/*.exe
targetPath: '$(Build.ArtifactStagingDirectory)/downloads'
displayName: Download windows x64 packages

Expand All @@ -197,10 +193,8 @@ jobs:
buildType: 'current'
artifact: drop_windows_package_package_win_x86
itemPattern: |
**/*.msi
**/*.msix
**/*.zip
**/*.exe
targetPath: '$(Build.ArtifactStagingDirectory)/downloads'
displayName: Download windows x86 packages

Expand Down Expand Up @@ -246,17 +240,17 @@ jobs:

- pwsh: |
Write-Verbose -Verbose "Copying Github Release files in $(Build.ArtifactStagingDirectory)/downloads to use in Release Pipeline"

Write-Verbose -Verbose "Creating output directory for GitHub Release files: $(ob_outputDirectory)/GitHubPackages"
New-Item -Path $(ob_outputDirectory)/GitHubPackages -ItemType Directory -Force
Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)/downloads/*" -Recurse |
Where-Object { $_.Extension -notin '.msix', '.nupkg' -and $_.Name -notmatch '-gc'} |
Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)/downloads/*" -Recurse |
Where-Object { $_.Extension -notin '.msix', '.nupkg' -and $_.Name -notmatch '-gc'} |
Copy-Item -Destination $(ob_outputDirectory)/GitHubPackages -Recurse -Verbose

Write-Verbose -Verbose "Creating output directory for NuGet packages: $(ob_outputDirectory)/NuGetPackages"
New-Item -Path $(ob_outputDirectory)/NuGetPackages -ItemType Directory -Force
Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)/downloads/*" -Recurse |
Where-Object { $_.Extension -eq '.nupkg' } |
Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)/downloads/*" -Recurse |
Where-Object { $_.Extension -eq '.nupkg' } |
Copy-Item -Destination $(ob_outputDirectory)/NuGetPackages -Recurse -Verbose
displayName: Copy downloads to Artifacts

Expand Down Expand Up @@ -395,7 +389,7 @@ jobs:
}

# To use -Include parameter, we need to use \* to get all files
$files = Get-ChildItem -Path $downloadsDirectory\* -Include @("*.deb", "*.tar.gz", "*.rpm", "*.msi", "*.zip", "*.pkg")
$files = Get-ChildItem -Path $downloadsDirectory\* -Include @("*.deb", "*.tar.gz", "*.rpm", "*.zip", "*.pkg")
Write-Verbose -Verbose "files to upload."
$files | Write-Verbose -Verbose

Expand Down
70 changes: 0 additions & 70 deletions 70 assets/MicrosoftUpdate/RegisterMicrosoftUpdate.ps1

This file was deleted.

Loading
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.