Skip to content

Commit 3bc1d94

Browse files
committed
Apply PR feedback
1 parent cb0ba0c commit 3bc1d94

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ jobs:
1313
# ================================
1414
windows:
1515
name: Windows
16-
runs-on: windows-latest
16+
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
19-
runtime: [win-x86, win-x64, win-arm64]
19+
include:
20+
- runtime: win-x86
21+
os: windows-latest
22+
- runtime: win-x64
23+
os: windows-latest
24+
- runtime: win-arm64
25+
os: windows-11-arm
2026

2127
steps:
2228
- uses: actions/checkout@v6
@@ -36,8 +42,6 @@ jobs:
3642
--runtime=${{ matrix.runtime }}
3743
3844
- name: Test
39-
# GitHub's hosted runners are x64 so can test x64 and x86, but not arm64
40-
if: matrix.runtime != 'win-arm64'
4145
run: |
4246
dotnet test --verbosity normal `
4347
--configuration=WindowsRelease `

src/windows/Installer.Windows/Installer.Windows.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
<!-- Implicit SDK props import -->
33
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
44

5+
<!-- Default RuntimeIdentifier to the host architecture if not specified -->
6+
<PropertyGroup Condition="'$(RuntimeIdentifier)' == ''">
7+
<RuntimeIdentifier Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64'">win-x64</RuntimeIdentifier>
8+
<RuntimeIdentifier Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X86'">win-x86</RuntimeIdentifier>
9+
<RuntimeIdentifier Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'">win-arm64</RuntimeIdentifier>
10+
</PropertyGroup>
11+
512
<PropertyGroup>
613
<TargetFramework>net472</TargetFramework>
714
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

src/windows/Installer.Windows/layout.ps1

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
# Inputs
2-
param ([Parameter(Mandatory)] $Configuration, [Parameter(Mandatory)] $Output, [Parameter(Mandatory)] $RuntimeIdentifier, $SymbolOutput)
2+
param ([Parameter(Mandatory)] $Configuration, [Parameter(Mandatory)] $Output, $RuntimeIdentifier, $SymbolOutput)
33

44
Write-Output "Output: $Output"
55

6+
# Determine a runtime if one was not provided
7+
if (-not $RuntimeIdentifier) {
8+
$arch = $env:PROCESSOR_ARCHITECTURE
9+
switch ($arch) {
10+
"AMD64" { $RuntimeIdentifier = "win-x64" }
11+
"x86" { $RuntimeIdentifier = "win-x86" }
12+
"ARM64" { $RuntimeIdentifier = "win-arm64" }
13+
default {
14+
Write-Host "Unknown architecture: $arch"
15+
exit 1
16+
}
17+
}
18+
}
19+
20+
Write-Output "Building for runtime '$RuntimeIdentifier'"
21+
622
if ($RuntimeIdentifier -ne 'win-x86' -and $RuntimeIdentifier -ne 'win-x64' -and $RuntimeIdentifier -ne 'win-arm64') {
723
Write-Host "Unsupported RuntimeIdentifier: $RuntimeIdentifier"
824
exit 1

0 commit comments

Comments
 (0)