Skip to content

Commit 1e7279a

Browse files
Merge pull request #65 from supervoidcoder/copilot/upgrade-ci-actions
ci: use native ARM64 runners and add merge commit release notes
2 parents 85e8d70 + ff643a7 commit 1e7279a

2 files changed

Lines changed: 69 additions & 16 deletions

File tree

.github/workflows/build.yml

Lines changed: 57 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,69 @@ on: [pull_request, push]
33
permissions:
44
contents: read
55
jobs:
6-
build-windows:
7-
runs-on: windows-latest
6+
build-and-test:
7+
strategy:
8+
matrix:
9+
include:
10+
- arch: x64
11+
runner: windows-latest
12+
vcvars_arch: x64
13+
- arch: x86
14+
runner: windows-latest
15+
vcvars_arch: x64_x86
16+
- arch: arm64
17+
runner: windows-11-arm
18+
vcvars_arch: arm64
19+
runs-on: ${{ matrix.runner }}
820
steps:
921
- uses: actions/checkout@v4
1022

11-
- name: Setup MSVC
12-
uses: ilammy/msvc-dev-cmd@v1
13-
14-
- name: Compile
15-
shell: pwsh
23+
- name: Compile for ${{ matrix.arch }}
24+
shell: cmd
1625
run: |
17-
cl /O2 /std:c++20 /EHsc main.cpp /DUNICODE /D_UNICODE /Fe:win-witr.exe
18-
# Add the current directory (where win-witr.exe was compiled) to PATH
19-
$env:PATH = "$PWD;$env:PATH"
20-
21-
# Verify the exe is accessible
22-
Write-Host "Checking win-witr.exe availability..."
23-
win-witr --version
24-
- name: Run Tests
26+
REM Find vcvarsall.bat dynamically - check both possible vswhere.exe locations
27+
set "VSWHERE_LEGACY=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
28+
set "VSWHERE_NATIVE=C:\Program Files\Microsoft Visual Studio\Installer\vswhere.exe"
29+
30+
if exist "%VSWHERE_LEGACY%" (
31+
set "VSWHERE_PATH=%VSWHERE_LEGACY%"
32+
) else if exist "%VSWHERE_NATIVE%" (
33+
set "VSWHERE_PATH=%VSWHERE_NATIVE%"
34+
) else (
35+
echo Error: vswhere.exe not found in either location.
36+
exit /b 1
37+
)
38+
39+
for /f "usebackq tokens=*" %%i in (`"%VSWHERE_PATH%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
40+
set "VS_PATH=%%i"
41+
)
42+
43+
if not exist "%VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat" (
44+
echo Error: vcvarsall.bat not found.
45+
exit /b 1
46+
)
47+
48+
REM Initialize environment for the target architecture
49+
call "%VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vcvars_arch }}
50+
51+
set outName=win-witr-${{ matrix.arch }}.exe
52+
echo Compiling %outName%...
53+
cl /O2 /GL /std:c++20 /EHsc main.cpp /DUNICODE /D_UNICODE /Fe:%outName%
54+
if errorlevel 1 exit /b 1
55+
56+
- name: Run Tests for ${{ matrix.arch }}
2557
shell: pwsh
2658
run: |
59+
# Add the current directory (where win-witr-${{ matrix.arch }}.exe was compiled) to PATH
60+
$env:PATH = "$PWD;$env:PATH"
61+
62+
# Copy the architecture-specific exe to the generic name for tests
63+
Copy-Item "win-witr-${{ matrix.arch }}.exe" "win-witr.exe"
64+
65+
# Verify the exe is accessible
66+
Write-Host "Checking win-witr.exe availability..."
67+
win-witr --version
68+
2769
# Run all test .bat files
2870
Get-ChildItem -Path tests -Recurse -Filter *.bat | ForEach-Object {
2971
Write-Host "Running test: $($_.FullName)"

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ jobs:
155155
Write-Output "DEBUG: Base SHA: $baseSha"
156156
Write-Output "DEBUG: Head SHA: $headSha"
157157
158+
# Get the merge commit (HEAD) message body for personal release notes
159+
$mergeCommitBody = git log -1 --pretty=format:"%b" HEAD
160+
Write-Output "DEBUG: Merge commit body: $mergeCommitBody"
161+
158162
# Get all commit messages in the PR
159163
$commits = @(git log --pretty=format:"%h|%s|%b" "$baseSha..$headSha")
160164
Write-Output "DEBUG: Found $($commits.Count) commits in PR"
@@ -215,7 +219,14 @@ jobs:
215219
}
216220
217221
# Build release notes
218-
$releaseNotes = "## Changes`n`n"
222+
$releaseNotes = ""
223+
224+
# Add merge commit body at the top if it exists
225+
if (-not [string]::IsNullOrWhiteSpace($mergeCommitBody)) {
226+
$releaseNotes += "$mergeCommitBody`n`n---`n`n"
227+
}
228+
229+
$releaseNotes += "## Changes`n`n"
219230
220231
if ($features.Count -gt 0) {
221232
$releaseNotes += "### ✨ Features`n"

0 commit comments

Comments
 (0)