-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (77 loc) · 2.76 KB
/
windows.yml
File metadata and controls
87 lines (77 loc) · 2.76 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Windows
on:
push:
branches: [ "master" ]
paths:
- DLLInjector/**
- InternetGamesClientDLL/**
- InternetGamesServer/**
pull_request:
branches: [ "master" ]
paths:
- DLLInjector/**
- InternetGamesClientDLL/**
- InternetGamesServer/**
workflow_dispatch:
jobs:
windows:
strategy:
matrix:
arch: [ x64, x86 ]
build_type: [ Debug, Release ]
runs-on: windows-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Detect VS 2022 install path
id: detect-vs
if: matrix.arch == 'x86'
shell: pwsh
run: |
$editions = "Enterprise","Professional","Community"
foreach ($edition in $editions) {
$path = "C:\Program Files\Microsoft Visual Studio\2022\$edition"
if (Test-Path $path) {
"VSPath=$path" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
exit 0
}
}
throw "Visual Studio 2022 installation not found!"
- name: Install v141_xp toolset and build tools
if: matrix.arch == 'x86'
shell: cmd
run: |
set "vsPath=${{ steps.detect-vs.outputs.VSPath }}"
set "installer=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe"
echo Installing v141_xp toolset and build tools into: %vsPath%.
"%installer%" modify ^
--installPath "%vsPath%" ^
--add Microsoft.VisualStudio.Component.VC.v141.x86.x64 ^
--add Microsoft.VisualStudio.Component.WinXP ^
--nocache --quiet --norestart
if %errorlevel% neq 0 (
echo Visual Studio component installation failed with error %errorlevel%!
exit /b %errorlevel%
)
echo Visual Studio component installation completed successfully.
- name: Build
env:
ARCH: ${{ matrix.arch }}
BUILD_TYPE: ${{ matrix.build_type }}
run: |
msbuild ZoneInternetGamesServer.sln /p:Configuration=$Env:BUILD_TYPE /p:Platform=$Env:ARCH
- name: Include Windows ME games patcher with build
env:
BUILD_DIR: ${{ (matrix.arch == 'x64' && 'x64/') || '' }}${{ matrix.build_type }}
run: |
copy InternetGamesPatcher_ME.vbs $Env:BUILD_DIR
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: "ZoneInternetGamesServer-Windows-${{ matrix.arch }}-${{ matrix.build_type }}-${{ github.sha }}-binaries"
path: "${{ (matrix.arch == 'x64' && 'x64/') || '' }}${{ matrix.build_type }}"