Skip to content

Commit 4031508

Browse files
committed
fix: move to node24
feat: enhance MSBuild setup summary in workflow 🛠️ - Added matrix strategy for multiple runners - Improved summary output for MSBuild paths and architecture
1 parent 767f00a commit 4031508

6 files changed

Lines changed: 3794 additions & 3768 deletions

File tree

.github/workflows/test.yml

Lines changed: 57 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,66 +4,76 @@ on:
44
branches:
55
- dev
66
paths-ignore:
7-
- '*.md'
7+
- "*.md"
88
push:
99
branches:
1010
- dev
1111
paths-ignore:
12-
- '*.md'
12+
- "*.md"
1313
workflow_dispatch:
14-
branches:
15-
- dev
16-
- arm64
17-
- master
18-
paths-ignore:
19-
- '*.md'
20-
2114

2215
jobs:
2316
build:
24-
runs-on: windows-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
runner:
21+
- windows-latest
22+
- windows-2025-vs2026
23+
runs-on: ${{ matrix.runner }}
2524
steps:
26-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v6
26+
27+
- name: Setup MSBuild (vswhere-path)
28+
id: setup_msbuild_explicit
29+
uses: ./
30+
with:
31+
vswhere-path: C:\ProgramData\chocolatey\bin
32+
33+
- name: Setup MSBuild (PATH)
34+
id: setup_msbuild_path
35+
uses: ./
2736

28-
- name: Setup MSBuild (vswhere-path)
29-
id: setup_msbuild_explicit
30-
uses: ./
31-
with:
32-
vswhere-path: C:\ProgramData\chocolatey\bin
37+
- name: Setup MSBuild (fallback)
38+
id: setup_msbuild_fallback
39+
uses: ./
40+
env:
41+
PATH: ""
3342

34-
- name: Setup MSBuild (PATH)
35-
id: setup_msbuild_path
36-
uses: ./
43+
- name: Setup MSBuild (x64)
44+
if: runner.arch == 'X64'
45+
id: setup_msbuild_path_x64
46+
uses: ./
47+
with:
48+
vs-prerelease: true
49+
msbuild-architecture: "x64"
3750

38-
- name: Setup MSBuild (fallback)
39-
id: setup_msbuild_fallback
40-
uses: ./
41-
env:
42-
PATH: ''
51+
- name: Setup MSBuild (arm64)
52+
if: runner.arch == 'ARM64'
53+
id: setup_msbuild_path_arm64
54+
uses: ./
55+
with:
56+
vs-prerelease: true
57+
msbuild-architecture: "arm64"
4358

44-
- name: Setup MSBuild (x64)
45-
if: always()
46-
id: setup_msbuild_path_x64
47-
uses: ./
48-
with:
49-
vs-prerelease: true
50-
msbuild-architecture: 'x64'
59+
- name: Write MSBuild summary
60+
if: always()
61+
shell: pwsh
62+
run: |
63+
@"
64+
## MSBuild setup summary
5165
52-
- name: Setup MSBuild (arm64)
53-
if: always()
54-
id: setup_msbuild_path_arm
55-
uses: ./
56-
with:
57-
vs-prerelease: true
58-
msbuild-architecture: 'arm64'
66+
- Runner label: `${{ matrix.runner }}`
67+
- Runner architecture: `${{ runner.arch }}`
5968
60-
- name: echo msbuild path
61-
run: |
62-
echo "vswhere-path: ${{ steps.setup_msbuild_explicit.outputs.msbuildPath }}"
63-
echo "PATH: ${{ steps.setup_msbuild_path.outputs.msbuildPath }}"
64-
echo "ARM PATH: ${{ steps.setup_msbuild_path_arm.outputs.msbuildPath }}"
65-
echo "ARM PATH: ${{ steps.setup_msbuild_path_x64.outputs.msbuildPath }}"
66-
echo "Fallback: ${{ steps.setup_msbuild_fallback.outputs.msbuildPath }}"
69+
| Probe | msbuildPath |
70+
| --- | --- |
71+
| vswhere-path | ${{ steps.setup_msbuild_explicit.outputs.msbuildPath || 'N/A' }} |
72+
| PATH | ${{ steps.setup_msbuild_path.outputs.msbuildPath || 'N/A' }} |
73+
| Fallback | ${{ steps.setup_msbuild_fallback.outputs.msbuildPath || 'N/A' }} |
74+
| x64 | ${{ steps.setup_msbuild_path_x64.outputs.msbuildPath || 'N/A' }} |
75+
| arm64 | ${{ steps.setup_msbuild_path_arm64.outputs.msbuildPath || 'N/A' }} |
76+
"@ | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
6777
68-
- name: echo MSBuild
69-
run: msbuild -version
78+
- name: echo MSBuild
79+
run: msbuild -version

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This action will help discover where the `MSBuild` tool is and automatically add
99

1010
```yml
1111
- name: Add msbuild to PATH
12-
uses: microsoft/setup-msbuild@v2
12+
uses: microsoft/setup-msbuild@v3
1313

1414
- name: Build app for release
1515
run: msbuild src\YourProjectFile.csproj -t:rebuild -verbosity:diag -property:Configuration=Release
@@ -29,7 +29,7 @@ You may have a situation where your Actions runner has multiple versions of Visu
2929

3030
```yml
3131
- name: Add msbuild to PATH
32-
uses: microsoft/setup-msbuild@v2
32+
uses: microsoft/setup-msbuild@v3
3333
with:
3434
vs-version: '[16.4,16.5)'
3535
```
@@ -42,7 +42,7 @@ If you need your Actions runner to target a pre-release version of Visual Studio
4242

4343
```yml
4444
- name: Add msbuild to PATH
45-
uses: microsoft/setup-msbuild@v2
45+
uses: microsoft/setup-msbuild@v3
4646
with:
4747
vs-prerelease: true
4848
```
@@ -53,7 +53,7 @@ By default the action will use the x86 architecture for MSBuild, but it is possi
5353

5454
```yml
5555
- name: Add msbuild to PATH
56-
uses: microsoft/setup-msbuild@v2
56+
uses: microsoft/setup-msbuild@v3
5757
with:
5858
msbuild-architecture: x64
5959
```
@@ -64,7 +64,7 @@ This makes use of the vswhere tool which is a tool delivered by Microsoft to hel
6464

6565
```yml
6666
- name: Add msbuild to PATH
67-
uses: microsoft/setup-msbuild@v2
67+
uses: microsoft/setup-msbuild@v3
6868
with:
6969
vswhere-path: 'C:\path\to\your\tools\'
7070
```

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ outputs:
2323
description: "The resulting location of msbuild for your inputs"
2424

2525
runs:
26-
using: "node20"
26+
using: "node24"
2727
main: "dist/index.js"

0 commit comments

Comments
 (0)