Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions .github/workflows/emu-build-all-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ jobs:
- name: "Checkout branch"
uses: actions/checkout@v4
with:
clean: false
# clean:true so stale generated/build artifacts from prior runs (e.g. a
# removed base_gcmessages.pb.* or old steam_api DLLs) can't get compiled,
# linked, or shipped. Deps live in C:\gbe-deps (junctioned later), so a
# clean checkout doesn't force a deps rebuild.
clean: true

- name: "Setup MSBuild"
uses: microsoft/setup-msbuild@v2
Expand Down Expand Up @@ -83,7 +87,11 @@ jobs:
shell: cmd
working-directory: "${{ github.workspace }}"
run: |
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --genproto --emubuild=${{ github.sha }} --dosstub --winrsrc --winsign --os=windows vs2022
rem No --dosstub/--winsign: that post-build tooling (file_dos_stub_x32.exe /
rem sign_helper.bat) crashes on the 32-bit DLL and removes the just-linked
rem output, and the emu DLLs don't need a replaced DOS stub or a code
rem signature to function. Keep --winrsrc (version resource) which is fine.
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --genproto --emubuild=${{ github.sha }} --winrsrc --os=windows vs2022

- name: "Build all targets"
shell: cmd
Expand All @@ -92,6 +100,11 @@ jobs:
@echo off
setlocal enabledelayedexpansion

rem The build job checks out with clean:false, so stale DLLs from a prior
rem build linger. Wipe the release output dir first so a target that fails
rem to build this run cannot ship a leftover DLL (false success).
if exist "%GITHUB_WORKSPACE%\build\win\vs2022\release" rmdir /s /q "%GITHUB_WORKSPACE%\build\win\vs2022\release"

for %%P in (api_regular api_experimental steamclient_experimental_stub steamclient_experimental steamclient_experimental_loader steamclient_experimental_extra lib_game_overlay_renderer lib_steamnetworkingsockets tool_lobby_connect tool_generate_interfaces) do (
for %%A in (x64 Win32) do (
echo === Building %%P [%%A release] ===
Expand All @@ -104,6 +117,33 @@ jobs:
msbuild /nologo /t:lib_steam_old /m /v:m /p:Configuration=release,Platform=Win32 gbe.sln
if errorlevel 1 echo Warning: lib_steam_old Win32 release build failed

rem Per-target failures above are warn-only (e.g. signing of a dev-only tool,
rem or lib_steam_old). Don't let them abort the job here; the next step gates
rem the release on the actual shippable DLLs existing.
exit /b 0

- name: "Verify shippable DLLs built"
shell: cmd
working-directory: "${{ github.workspace }}"
run: |
setlocal enabledelayedexpansion
set "OUT=%GITHUB_WORKSPACE%\build\win\vs2022\release"
set "MISSING="
rem premake emits 32-bit to the x86 dir (and 64-bit to x64).
for %%F in (
"regular\x64\steam_api64.dll"
"regular\x86\steam_api.dll"
"experimental\x64\steam_api64.dll"
"experimental\x86\steam_api.dll"
) do (
if exist "%OUT%\%%~F" ( echo OK: %%~F ) else ( echo MISSING: %%~F & set "MISSING=1" )
)
if defined MISSING (
echo One or more shippable steam_api DLLs are missing - failing the build.
exit /b 1
)
echo All shippable steam_api DLLs present.

- name: "Package build (release)"
shell: cmd
working-directory: "${{ github.workspace }}"
Expand Down
38 changes: 35 additions & 3 deletions .github/workflows/emu-deps-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@ name: "Emu third-party dependencies (Windows)"

on:
workflow_call:
inputs:
force_rebuild:
description: "Wipe the local deps cache and rebuild from scratch"
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
force_rebuild:
description: "Wipe the local deps cache and rebuild from scratch"
required: false
type: boolean
default: false

permissions:
contents: "write"
Expand All @@ -23,12 +35,24 @@ jobs:
id: "local-deps-check"
shell: cmd
run: |
if exist "%LOCAL_DEPS_DIR%\vs2022\protobuf\install64" (
if /I "${{ inputs.force_rebuild }}"=="true" (
echo Force rebuild requested - wiping %LOCAL_DEPS_DIR%\vs2022
if exist "%LOCAL_DEPS_DIR%\vs2022" rmdir /s /q "%LOCAL_DEPS_DIR%\vs2022"
)
rem Require markers from multiple deps, not just protobuf: a partial cache
rem (e.g. protobuf present but zlibstatic.lib missing) used to pass this
rem check and never refresh, which broke api_regular linking. Treat a
rem missing critical lib as "needs rebuild".
set DEPS_OK=1
if not exist "%LOCAL_DEPS_DIR%\vs2022\protobuf\install64" set DEPS_OK=0
if not exist "%LOCAL_DEPS_DIR%\vs2022\zlib\install64\lib\zlibstatic.lib" set DEPS_OK=0
if not exist "%LOCAL_DEPS_DIR%\vs2022\sdl\install64\lib\SDL3-static.lib" set DEPS_OK=0
if "%DEPS_OK%"=="1" (
echo deps_exist=true>>%GITHUB_OUTPUT%
echo Deps already exist at %LOCAL_DEPS_DIR%
echo Deps already exist and look complete at %LOCAL_DEPS_DIR%
) else (
echo deps_exist=false>>%GITHUB_OUTPUT%
echo Deps not found, will build
echo Deps missing or incomplete, will build
)

- name: "Checkout branch"
Expand Down Expand Up @@ -60,6 +84,14 @@ jobs:
ref: "third-party/deps/common"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common"

- name: "Enable long paths (best-effort)"
if: steps.local-deps-check.outputs.deps_exist != 'true'
shell: cmd
run: |
rem Deeply nested dep build paths (abseil etc.) can exceed Windows' 260-char
rem MAX_PATH. Best-effort enable long paths; ignore failure if not admin.
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f || ver > nul

- name: "Build deps"
if: steps.local-deps-check.outputs.deps_exist != 'true'
shell: cmd
Expand Down
Loading
Loading