Skip to content
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: 18 additions & 0 deletions .github/actions/infrastructure/path-filters/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ outputs:
buildModuleChanged:
description: 'Build module changes'
value: ${{ steps.filter.outputs.buildModuleChanged }}
packagingChanged:
description: 'Packaging related changes'
value: ${{ steps.filter.outputs.packagingChanged }}
runs:
using: composite
steps:
Expand Down Expand Up @@ -85,6 +88,19 @@ runs:

const globalConfigChanged = files.some(file => file.filename.startsWith('.globalconfig')) || files.some(file => file.filename.startsWith('nuget.config')) || files.some(file => file.filename.startsWith('global.json'));

const packagingChanged = files.some(file =>
file.filename === '.github/workflows/windows-ci.yml' ||
file.filename.startsWith('assets/wix/') ||
file.filename === 'PowerShell.Common.props' ||
file.filename.match(/^src\/.*\.csproj$/) ||
file.filename.startsWith('test/packaging/windows/') ||
file.filename.startsWith('tools/packaging/') ||
file.filename.startsWith('tools/wix/')
) ||
buildModuleChanged ||
globalConfigChanged ||
toolsCiPsm1Changed;

const source = mainSourceChanged || toolsChanged || githubChanged || propsChanged || testsChanged || globalConfigChanged;

core.setOutput('toolsChanged', toolsChanged);
Expand All @@ -94,6 +110,7 @@ runs:
core.setOutput('mainSourceChanged', mainSourceChanged);
core.setOutput('buildModuleChanged', buildModuleChanged);
core.setOutput('globalConfigChanged', globalConfigChanged);
core.setOutput('packagingChanged', packagingChanged);
core.setOutput('source', source);


Expand All @@ -106,4 +123,5 @@ runs:
Write-Verbose -Verbose "tests: ${{ steps.filter.outputs.testsChanged }}"
Write-Verbose -Verbose "mainSource: ${{ steps.filter.outputs.mainSourceChanged }}"
Write-Verbose -Verbose "buildModule: ${{ steps.filter.outputs.buildModuleChanged }}"
Write-Verbose -Verbose "packaging: ${{ steps.filter.outputs.packagingChanged }}"
shell: pwsh
10 changes: 10 additions & 0 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ env:
POWERSHELL_TELEMETRY_OPTOUT: 1
__SuppressAnsiEscapeSequences: 1
nugetMultiFeedWarnLevel: none
SYSTEM_ARTIFACTSDIRECTORY: ${{ github.workspace }}/artifacts
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts
jobs:
changes:
name: Change Detection
Expand All @@ -54,6 +56,7 @@ jobs:
# Set job outputs to values from filter step
outputs:
source: ${{ steps.filter.outputs.source }}
packagingChanged: ${{ steps.filter.outputs.packagingChanged }}
steps:
- name: checkout
uses: actions/checkout@v5
Expand Down Expand Up @@ -158,6 +161,12 @@ jobs:
fetch-depth: 1000
- name: Verify xUnit test results
uses: "./.github/actions/test/verify_xunit"
windows_packaging:
name: Windows Packaging
needs:
- changes
if: ${{ needs.changes.outputs.packagingChanged == 'true' }}
uses: ./.github/workflows/windows-packaging-reusable.yml
ready_to_merge:
name: windows ready to merge
needs:
Expand All @@ -166,6 +175,7 @@ jobs:
- windows_test_elevated_others
- windows_test_unelevated_ci
- windows_test_unelevated_others
- windows_packaging
if: always()
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0
with:
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/windows-packaging-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Windows Packaging (Reusable)

on:
workflow_call:

env:
GIT_CONFIG_PARAMETERS: "'core.autocrlf=false'"
DOTNET_CLI_TELEMETRY_OPTOUT: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
__SuppressAnsiEscapeSequences: 1
nugetMultiFeedWarnLevel: none
SYSTEM_ARTIFACTSDIRECTORY: ${{ github.workspace }}/artifacts
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts

jobs:
package:
name: ${{ matrix.architecture }} - ${{ matrix.channel }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- architecture: x64
channel: preview
runtimePrefix: win7
- architecture: x86
channel: stable
runtimePrefix: win7
- architecture: x86
channel: preview
runtimePrefix: win7
- architecture: arm64
channel: preview
runtimePrefix: win

steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 1000

- name: Capture Environment
if: success() || failure()
run: |
Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
shell: pwsh

- name: Capture PowerShell Version Table
if: success() || failure()
run: |
$PSVersionTable
shell: pwsh

- name: Switch to Public Feeds
if: success()
run: |
Import-Module .\tools\ci.psm1
Switch-PSNugetConfig -Source Public
shell: pwsh

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: ./global.json

- name: Bootstrap
if: success()
run: |
Import-Module .\tools\ci.psm1
Invoke-CIInstall -SkipUser
shell: pwsh

- name: Build and Package
run: |
Import-Module .\tools\ci.psm1
New-CodeCoverageAndTestPackage
Invoke-CIFinish -Runtime ${{ matrix.runtimePrefix }}-${{ matrix.architecture }} -channel ${{ matrix.channel }}
shell: pwsh

- name: Upload Build Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: windows-packaging-${{ matrix.architecture }}-${{ matrix.channel }}
path: |
${{ github.workspace }}/artifacts/**/*
!${{ github.workspace }}/artifacts/**/*.pdb
Loading