Skip to content

Commit 0d5d7de

Browse files
CopilotTravisEz13
andauthored
Integrate Windows packaging into windows-ci workflow using reusable workflow (#26224)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
1 parent 2786fce commit 0d5d7de

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

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

Lines changed: 18 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:
@@ -85,6 +88,19 @@ runs:
8588
8689
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'));
8790
91+
const packagingChanged = files.some(file =>
92+
file.filename === '.github/workflows/windows-ci.yml' ||
93+
file.filename.startsWith('assets/wix/') ||
94+
file.filename === 'PowerShell.Common.props' ||
95+
file.filename.match(/^src\/.*\.csproj$/) ||
96+
file.filename.startsWith('test/packaging/windows/') ||
97+
file.filename.startsWith('tools/packaging/') ||
98+
file.filename.startsWith('tools/wix/')
99+
) ||
100+
buildModuleChanged ||
101+
globalConfigChanged ||
102+
toolsCiPsm1Changed;
103+
88104
const source = mainSourceChanged || toolsChanged || githubChanged || propsChanged || testsChanged || globalConfigChanged;
89105
90106
core.setOutput('toolsChanged', toolsChanged);
@@ -94,6 +110,7 @@ runs:
94110
core.setOutput('mainSourceChanged', mainSourceChanged);
95111
core.setOutput('buildModuleChanged', buildModuleChanged);
96112
core.setOutput('globalConfigChanged', globalConfigChanged);
113+
core.setOutput('packagingChanged', packagingChanged);
97114
core.setOutput('source', source);
98115
99116
@@ -106,4 +123,5 @@ runs:
106123
Write-Verbose -Verbose "tests: ${{ steps.filter.outputs.testsChanged }}"
107124
Write-Verbose -Verbose "mainSource: ${{ steps.filter.outputs.mainSourceChanged }}"
108125
Write-Verbose -Verbose "buildModule: ${{ steps.filter.outputs.buildModuleChanged }}"
126+
Write-Verbose -Verbose "packaging: ${{ steps.filter.outputs.packagingChanged }}"
109127
shell: pwsh

.github/workflows/windows-ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ env:
4141
POWERSHELL_TELEMETRY_OPTOUT: 1
4242
__SuppressAnsiEscapeSequences: 1
4343
nugetMultiFeedWarnLevel: none
44+
SYSTEM_ARTIFACTSDIRECTORY: ${{ github.workspace }}/artifacts
45+
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts
4446
jobs:
4547
changes:
4648
name: Change Detection
@@ -54,6 +56,7 @@ jobs:
5456
# Set job outputs to values from filter step
5557
outputs:
5658
source: ${{ steps.filter.outputs.source }}
59+
packagingChanged: ${{ steps.filter.outputs.packagingChanged }}
5760
steps:
5861
- name: checkout
5962
uses: actions/checkout@v5
@@ -158,6 +161,12 @@ jobs:
158161
fetch-depth: 1000
159162
- name: Verify xUnit test results
160163
uses: "./.github/actions/test/verify_xunit"
164+
windows_packaging:
165+
name: Windows Packaging
166+
needs:
167+
- changes
168+
if: ${{ needs.changes.outputs.packagingChanged == 'true' }}
169+
uses: ./.github/workflows/windows-packaging-reusable.yml
161170
ready_to_merge:
162171
name: windows ready to merge
163172
needs:
@@ -166,6 +175,7 @@ jobs:
166175
- windows_test_elevated_others
167176
- windows_test_unelevated_ci
168177
- windows_test_unelevated_others
178+
- windows_packaging
169179
if: always()
170180
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0
171181
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)