Replace CI stubs with SteamCMD game DLL download#23
Conversation
Co-authored-by: Brollyy <12004018+Brollyy@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the CI/release pipeline to build against the real Bits & Bops managed DLLs (downloaded via SteamCMD) instead of compiling with SKIP_GAME_REFERENCES stubs, aligning CI behavior more closely with the actual runtime environment for this BepInEx mod.
Changes:
- Added a reusable workflow to download/cache/upload the game’s managed DLLs via SteamCMD.
- Updated PR and release workflows to consume the downloaded DLLs and build without stubbed game references.
- Removed
SKIP_GAME_REFERENCES/SkipGameReferencessupport from the project and deleted the CI stub file.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/setup-game-dlls.yml |
New reusable workflow to fetch/caches Bits & Bops managed DLLs and publish them as an artifact. |
.github/workflows/build-on-pr.yml |
PR CI now calls setup-game-dlls then builds using the downloaded managed DLLs. |
.github/workflows/release-new-version.yml |
Release flow now downloads game DLLs in parallel, builds with real refs, and updates token usage/exit behavior. |
BopVisualEffects/BopVisualEffects.csproj |
Removes stub-based build path and adjusts Unity/game reference handling and validation targets. |
BopVisualEffects/Stubs/CiGameTypeStubs.cs |
Deleted obsolete CI-only type stubs. |
Comments suppressed due to low confidence (1)
BopVisualEffects/BopVisualEffects.csproj:81
ValidateTemplateDependenciesnow always runs and unconditionally errors when$(UnityManagedDir)doesn't exist. BecauseUnityManagedDiris empty unlessGameRootis set, this will fail local builds and the existingformat-and-styleCI jobs (they don't setGameRoot). Consider gating this target/error with a condition likeCondition="'$(UnityManagedDir)' != ''"(or changing theErrorcondition to only fire whenUnityManagedDiris non-empty).
<Target Name="ValidateTemplateDependencies" BeforeTargets="ResolveReferences">
<ItemGroup>
<MissingGameLibrary Include="@(GameLibrary)"
Condition="'$(UnityManagedDir)' != '' and !Exists('$(UnityManagedDir)/%(Identity).dll')"/>
</ItemGroup>
<Error Condition="!Exists('$(UnityManagedDir)')"
Text="Unity managed directory not found. Set GameRoot in BopVisualEffects.user.props (or BOP_GAME_ROOT env var)."/>
<Error Condition="'@(MissingGameLibrary)' != ''"
| <PackageReference Include="Unity3D.UnityEngine" Version="2018.3.5.1" IncludeAssets="compile"/> | ||
| <Reference Include="UnityEngine" Condition="Exists('$(UnityManagedDir)/UnityEngine.dll')"> | ||
| <HintPath>$(UnityManagedDir)/UnityEngine.dll</HintPath> | ||
| <Private>false</Private> | ||
| </Reference> | ||
| <Reference Include="UnityEngine.CoreModule" Condition="'$(SkipGameReferences)' != 'true' and Exists('$(UnityManagedDir)/UnityEngine.CoreModule.dll')"> | ||
| <Reference Include="UnityEngine.CoreModule" Condition="Exists('$(UnityManagedDir)/UnityEngine.CoreModule.dll')"> |
There was a problem hiding this comment.
Unity3D.UnityEngine is now always referenced via NuGet and the project also adds direct file references to UnityEngine*.dll when $(UnityManagedDir) exists. This can introduce duplicate/ambiguous references (and potentially compile against the NuGet assembly instead of the game's Unity assemblies). Make these mutually exclusive (e.g., only use the NuGet package when $(UnityManagedDir)/game DLLs are unavailable).
There was a problem hiding this comment.
Fixed in 0f9ecde — Unity3D.UnityEngine NuGet now has Condition="'$(UnityManagedDir)' == ''", so it's only pulled in when game DLLs aren't available. When GameRoot is configured (build/release jobs that download real DLLs), $(UnityManagedDir) is non-empty and the NuGet is excluded, eliminating the CS0433 duplicate-type errors.
|
@copilot Analyzers and build fail - resolve the issues. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Brollyy <12004018+Brollyy@users.noreply.github.com>
Fixed in 0f9ecde. Two root causes:
|
.github/workflows/setup-game-dlls.yml(replicated exactly from BopSubtitleReader).github/workflows/build-on-pr.ymlto usesetup-game-dllsreusable workflow and real game DLLs.github/workflows/release-new-version.ymlto usesetup-game-dlls, real game DLLs, andRELEASE_TOKENBopVisualEffects/BopVisualEffects.csprojto removeSkipGameReferences/SKIP_GAME_REFERENCESlogic; makeUnity3D.UnityEngineNuGet conditional on$(UnityManagedDir) == ''to avoid CS0433 duplicate type errors when game DLLs are presentBopVisualEffects/Stubs/CiGameTypeStubs.csUnity3D.UnityEngineNuGet + game DLLs caused CS0433 duplicate types — made NuGet conditional on no$(UnityManagedDir)dotnet format analyzersexited code 2 without game types — addedsetup-game-dllstoformat-and-style.ymlanalyzers job, with game DLLs download and user.props creationsetup-game-dlls.ymlcache key: use stablebits-and-bops-1929290-managed-{os}-v1instead of per-commitgithub.sharelease-new-version.yml: remove invalidtoken:fromupload-artifact@v4; usegithub-token:fordownload-artifact@v4permissions: contents: readtoformat-and-style.yml(security hardening, matchingbuild-on-pr.yml)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.