-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (55 loc) · 2.2 KB
/
Copy pathbuild.yml
File metadata and controls
65 lines (55 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install vpatch
run: dotnet tool install --global Nefarius.Tools.Vpatch
- name: Stamp version in resource file
shell: pwsh
run: |
$version = "0.0.${{ github.run_number }}"
vpatch --stamp-version $version --target-file "res\app.rc" --resource.file-version --resource.product-version
- name: Bootstrap vcpkg
run: vcpkg/bootstrap-vcpkg.bat
- name: Get GameInput SDK
shell: pwsh
run: |
$version = "3.3.163"
$nupkgUrl = "https://api.nuget.org/v3-flatcontainer/microsoft.gameinput/$version/microsoft.gameinput.$version.nupkg"
$sdkDir = "$env:RUNNER_TEMP\GameInputSdk"
New-Item -ItemType Directory -Path $sdkDir -Force | Out-Null
$nupkgPath = "$sdkDir\microsoft.gameinput.$version.nupkg"
Invoke-WebRequest -Uri $nupkgUrl -OutFile $nupkgPath -UseBasicParsing
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($nupkgPath, $sdkDir)
Remove-Item $nupkgPath -Force
$nativePath = "$sdkDir\build\native"
if (-not (Test-Path $nativePath)) {
$subdir = Get-ChildItem -Path $sdkDir -Directory | Select-Object -First 1
if ($subdir) { $nativePath = (Join-Path $subdir.FullName "build\native") }
}
if (-not (Test-Path $nativePath)) {
Write-Error "GameInput SDK build/native not found under $sdkDir"
exit 1
}
$nativePath = (Resolve-Path $nativePath).Path
echo "GAMEINPUT_ROOT=$nativePath" >> $env:GITHUB_ENV
- name: Configure
run: cmake --preset default -DUSE_GAMEINPUT=ON -DGAMEINPUT_ROOT=$env:GAMEINPUT_ROOT
- name: Build Release
run: cmake --build --preset release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: MultiPadTester
path: build/Release/MultiPadTester.exe