mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
[release/v7.5] Integrate Windows packaging into windows-ci workflow using reusable workflow (#26390)
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
TravisEz13
parent
ce09a42fc8
commit
053db9864e
@@ -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:
|
||||
@@ -83,6 +86,18 @@ runs:
|
||||
|
||||
const buildModuleChanged = files.some(file => file.filename.startsWith('build.psm1'));
|
||||
|
||||
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 ||
|
||||
toolsCiPsm1Changed;
|
||||
|
||||
const source = mainSourceChanged || toolsChanged || githubChanged || propsChanged || testsChanged;
|
||||
|
||||
core.setOutput('toolsChanged', toolsChanged);
|
||||
@@ -91,6 +106,7 @@ runs:
|
||||
core.setOutput('testsChanged', testsChanged);
|
||||
core.setOutput('mainSourceChanged', mainSourceChanged);
|
||||
core.setOutput('buildModuleChanged', buildModuleChanged);
|
||||
core.setOutput('packagingChanged', packagingChanged);
|
||||
core.setOutput('source', source);
|
||||
|
||||
- name: Capture outputs
|
||||
@@ -102,4 +118,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
|
||||
|
||||
@@ -39,6 +39,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
|
||||
@@ -52,6 +54,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@v4.1.0
|
||||
@@ -156,6 +159,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:
|
||||
@@ -164,6 +173,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:
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user