Skip to content

Commit bda4360

Browse files
CopilotpwshBot
authored andcommitted
Cherry-pick PR PowerShell#26224 with conflicts for manual resolution
1 parent fa7640b commit bda4360

3 files changed

Lines changed: 126 additions & 0 deletions

File tree

.github/actions/infrastructure/path-filters/action.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ outputs:
2626
buildModuleChanged:
2727
description: 'Build module changes'
2828
value: ${{ steps.filter.outputs.buildModuleChanged }}
29+
packagingChanged:
30+
description: 'Packaging related changes'
31+
value: ${{ steps.filter.outputs.packagingChanged }}
2932
runs:
3033
using: composite
3134
steps:
@@ -83,14 +86,38 @@ runs:
8386
8487
const buildModuleChanged = files.some(file => file.filename.startsWith('build.psm1'));
8588
89+
<<<<<<< HEAD
8690
const source = mainSourceChanged || toolsChanged || githubChanged || propsChanged || testsChanged;
91+
=======
92+
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'));
93+
94+
const packagingChanged = files.some(file =>
95+
file.filename === '.github/workflows/windows-ci.yml' ||
96+
file.filename.startsWith('assets/wix/') ||
97+
file.filename === 'PowerShell.Common.props' ||
98+
file.filename.match(/^src\/.*\.csproj$/) ||
99+
file.filename.startsWith('test/packaging/windows/') ||
100+
file.filename.startsWith('tools/packaging/') ||
101+
file.filename.startsWith('tools/wix/')
102+
) ||
103+
buildModuleChanged ||
104+
globalConfigChanged ||
105+
toolsCiPsm1Changed;
106+
107+
const source = mainSourceChanged || toolsChanged || githubChanged || propsChanged || testsChanged || globalConfigChanged;
108+
>>>>>>> 0d5d7deef (Integrate Windows packaging into windows-ci workflow using reusable workflow (#26224))
87109

88110
core.setOutput('toolsChanged', toolsChanged);
89111
core.setOutput('githubChanged', githubChanged);
90112
core.setOutput('propsChanged', propsChanged);
91113
core.setOutput('testsChanged', testsChanged);
92114
core.setOutput('mainSourceChanged', mainSourceChanged);
93115
core.setOutput('buildModuleChanged', buildModuleChanged);
116+
<<<<<<< HEAD
117+
=======
118+
core.setOutput('globalConfigChanged', globalConfigChanged);
119+
core.setOutput('packagingChanged', packagingChanged);
120+
>>>>>>> 0d5d7deef (Integrate Windows packaging into windows-ci workflow using reusable workflow (#26224))
94121
core.setOutput('source', source);
95122

96123
- name: Capture outputs
@@ -102,4 +129,5 @@ runs:
102129
Write-Verbose -Verbose "tests: ${{ steps.filter.outputs.testsChanged }}"
103130
Write-Verbose -Verbose "mainSource: ${{ steps.filter.outputs.mainSourceChanged }}"
104131
Write-Verbose -Verbose "buildModule: ${{ steps.filter.outputs.buildModuleChanged }}"
132+
Write-Verbose -Verbose "packaging: ${{ steps.filter.outputs.packagingChanged }}"
105133
shell: pwsh

.github/workflows/windows-ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ env:
3939
POWERSHELL_TELEMETRY_OPTOUT: 1
4040
__SuppressAnsiEscapeSequences: 1
4141
nugetMultiFeedWarnLevel: none
42+
SYSTEM_ARTIFACTSDIRECTORY: ${{ github.workspace }}/artifacts
43+
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts
4244
jobs:
4345
changes:
4446
name: Change Detection
@@ -52,6 +54,7 @@ jobs:
5254
# Set job outputs to values from filter step
5355
outputs:
5456
source: ${{ steps.filter.outputs.source }}
57+
packagingChanged: ${{ steps.filter.outputs.packagingChanged }}
5558
steps:
5659
- name: checkout
5760
uses: actions/checkout@v4.1.0
@@ -156,6 +159,12 @@ jobs:
156159
fetch-depth: 1000
157160
- name: Verify xUnit test results
158161
uses: "./.github/actions/test/verify_xunit"
162+
windows_packaging:
163+
name: Windows Packaging
164+
needs:
165+
- changes
166+
if: ${{ needs.changes.outputs.packagingChanged == 'true' }}
167+
uses: ./.github/workflows/windows-packaging-reusable.yml
159168
ready_to_merge:
160169
name: windows ready to merge
161170
needs:
@@ -164,6 +173,7 @@ jobs:
164173
- windows_test_elevated_others
165174
- windows_test_unelevated_ci
166175
- windows_test_unelevated_others
176+
- windows_packaging
167177
if: always()
168178
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0
169179
with:
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Windows Packaging (Reusable)
2+
3+
on:
4+
workflow_call:
5+
6+
env:
7+
GIT_CONFIG_PARAMETERS: "'core.autocrlf=false'"
8+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
9+
POWERSHELL_TELEMETRY_OPTOUT: 1
10+
DOTNET_NOLOGO: 1
11+
__SuppressAnsiEscapeSequences: 1
12+
nugetMultiFeedWarnLevel: none
13+
SYSTEM_ARTIFACTSDIRECTORY: ${{ github.workspace }}/artifacts
14+
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts
15+
16+
jobs:
17+
package:
18+
name: ${{ matrix.architecture }} - ${{ matrix.channel }}
19+
runs-on: windows-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- architecture: x64
25+
channel: preview
26+
runtimePrefix: win7
27+
- architecture: x86
28+
channel: stable
29+
runtimePrefix: win7
30+
- architecture: x86
31+
channel: preview
32+
runtimePrefix: win7
33+
- architecture: arm64
34+
channel: preview
35+
runtimePrefix: win
36+
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v5
40+
with:
41+
fetch-depth: 1000
42+
43+
- name: Capture Environment
44+
if: success() || failure()
45+
run: |
46+
Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
47+
shell: pwsh
48+
49+
- name: Capture PowerShell Version Table
50+
if: success() || failure()
51+
run: |
52+
$PSVersionTable
53+
shell: pwsh
54+
55+
- name: Switch to Public Feeds
56+
if: success()
57+
run: |
58+
Import-Module .\tools\ci.psm1
59+
Switch-PSNugetConfig -Source Public
60+
shell: pwsh
61+
62+
- name: Setup .NET
63+
uses: actions/setup-dotnet@v4
64+
with:
65+
global-json-file: ./global.json
66+
67+
- name: Bootstrap
68+
if: success()
69+
run: |
70+
Import-Module .\tools\ci.psm1
71+
Invoke-CIInstall -SkipUser
72+
shell: pwsh
73+
74+
- name: Build and Package
75+
run: |
76+
Import-Module .\tools\ci.psm1
77+
New-CodeCoverageAndTestPackage
78+
Invoke-CIFinish -Runtime ${{ matrix.runtimePrefix }}-${{ matrix.architecture }} -channel ${{ matrix.channel }}
79+
shell: pwsh
80+
81+
- name: Upload Build Artifacts
82+
if: always()
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: windows-packaging-${{ matrix.architecture }}-${{ matrix.channel }}
86+
path: |
87+
${{ github.workspace }}/artifacts/**/*
88+
!${{ github.workspace }}/artifacts/**/*.pdb

0 commit comments

Comments
 (0)