Skip to content

Replace CI stubs with SteamCMD game DLL download#23

Merged
Brollyy merged 7 commits intomasterfrom
copilot/update-github-actions-workflows
Mar 1, 2026
Merged

Replace CI stubs with SteamCMD game DLL download#23
Brollyy merged 7 commits intomasterfrom
copilot/update-github-actions-workflows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

  • Create .github/workflows/setup-game-dlls.yml (replicated exactly from BopSubtitleReader)
  • Update .github/workflows/build-on-pr.yml to use setup-game-dlls reusable workflow and real game DLLs
  • Update .github/workflows/release-new-version.yml to use setup-game-dlls, real game DLLs, and RELEASE_TOKEN
  • Update BopVisualEffects/BopVisualEffects.csproj to remove SkipGameReferences/SKIP_GAME_REFERENCES logic; make Unity3D.UnityEngine NuGet conditional on $(UnityManagedDir) == '' to avoid CS0433 duplicate type errors when game DLLs are present
  • Delete BopVisualEffects/Stubs/CiGameTypeStubs.cs
  • Fix CI build failure: Unity3D.UnityEngine NuGet + game DLLs caused CS0433 duplicate types — made NuGet conditional on no $(UnityManagedDir)
  • Fix CI analyzer failure: dotnet format analyzers exited code 2 without game types — added setup-game-dlls to format-and-style.yml analyzers job, with game DLLs download and user.props creation
  • Fix setup-game-dlls.yml cache key: use stable bits-and-bops-1929290-managed-{os}-v1 instead of per-commit github.sha
  • Fix release-new-version.yml: remove invalid token: from upload-artifact@v4; use github-token: for download-artifact@v4
  • Add permissions: contents: read to format-and-style.yml (security hardening, matching build-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.

Co-authored-by: Brollyy <12004018+Brollyy@users.noreply.github.com>
Copilot AI changed the title [WIP] Update GitHub Actions workflows for BopSubtitleReader Replace CI stubs with SteamCMD game DLL download Mar 1, 2026
@Brollyy Brollyy marked this pull request as ready for review March 1, 2026 17:56
Copilot AI review requested due to automatic review settings March 1, 2026 17:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/SkipGameReferences support 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

  • ValidateTemplateDependencies now always runs and unconditionally errors when $(UnityManagedDir) doesn't exist. Because UnityManagedDir is empty unless GameRoot is set, this will fail local builds and the existing format-and-style CI jobs (they don't set GameRoot). Consider gating this target/error with a condition like Condition="'$(UnityManagedDir)' != ''" (or changing the Error condition to only fire when UnityManagedDir is 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)' != ''"

Comment on lines +41 to +46
<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')">
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0f9ecdeUnity3D.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.

Comment thread .github/workflows/build-on-pr.yml
Comment thread .github/workflows/setup-game-dlls.yml Outdated
Comment thread .github/workflows/release-new-version.yml
Comment thread .github/workflows/release-new-version.yml Outdated
Comment thread .github/workflows/release-new-version.yml Outdated
@Brollyy
Copy link
Copy Markdown
Owner

Brollyy commented Mar 1, 2026

@copilot Analyzers and build fail - resolve the issues.

Brollyy and others added 4 commits March 1, 2026 19:02
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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 1, 2026

@copilot Analyzers and build fail - resolve the issues.

Fixed in 0f9ecde. Two root causes:

  1. Build failure (CS0433): Unity3D.UnityEngine NuGet was unconditionally included alongside the real game DLLs, causing duplicate type errors. Fixed by adding Condition="'$(UnityManagedDir)' == ''" to the NuGet reference.
  2. Analyzer failure (exit code 2): dotnet format analyzers can't compile without game types (MixtapeEventTemplate, SceneKey, etc.) from Assembly-CSharp.dll. Fixed by adding a setup-game-dlls job to format-and-style.yml and updating the analyzers job to depend on it (same pattern as build-on-pr.yml).

Comment thread .github/workflows/build-on-pr.yml Outdated
@Brollyy Brollyy merged commit f54e69e into master Mar 1, 2026
6 checks passed
@Brollyy Brollyy deleted the copilot/update-github-actions-workflows branch March 1, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants