diff --git a/.github/workflows/build-on-pr.yml b/.github/workflows/build-on-pr.yml
index cc149cb..aba3a81 100644
--- a/.github/workflows/build-on-pr.yml
+++ b/.github/workflows/build-on-pr.yml
@@ -9,7 +9,14 @@ permissions:
contents: read
jobs:
+ setup-game-dlls:
+ uses: ./.github/workflows/setup-game-dlls.yml
+ secrets:
+ STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
+ STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
+
build-on-pr:
+ needs: setup-game-dlls
runs-on: ubuntu-latest
steps:
@@ -21,8 +28,25 @@ jobs:
with:
dotnet-version: 9.0.x
+ - name: Download game DLLs artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: game-dlls
+ path: ~/bits-and-bops/Bits & Bops_Data/Managed
+
+ - name: Create BopVisualEffects.user.props
+ run: |
+ mkdir -p BopVisualEffects
+ cat > BopVisualEffects/BopVisualEffects.user.props << EOF
+
+
+ $HOME/bits-and-bops
+
+
+ EOF
+
- name: Restore
- run: dotnet restore BopVisualEffects.sln -p:SkipGameReferences=true
+ run: dotnet restore BopVisualEffects.sln
- name: Build
- run: dotnet build BopVisualEffects.sln -c Release -p:SkipGameReferences=true --no-restore
+ run: dotnet build BopVisualEffects.sln -c Release --no-restore
diff --git a/.github/workflows/format-and-style.yml b/.github/workflows/format-and-style.yml
index 74fcae0..cc36311 100644
--- a/.github/workflows/format-and-style.yml
+++ b/.github/workflows/format-and-style.yml
@@ -5,7 +5,16 @@ on:
branches: ["master"]
merge_group:
+permissions:
+ contents: read
+
jobs:
+ setup-game-dlls:
+ uses: ./.github/workflows/setup-game-dlls.yml
+ secrets:
+ STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
+ STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
+
whitespace-format:
runs-on: ubuntu-latest
@@ -43,6 +52,7 @@ jobs:
run: dotnet format style BopVisualEffects.sln --no-restore --verify-no-changes --verbosity minimal --exclude BopVisualEffects/obj
analyzers:
+ needs: setup-game-dlls
runs-on: ubuntu-latest
steps:
@@ -54,8 +64,25 @@ jobs:
with:
dotnet-version: 9.0.x
+ - name: Download game DLLs artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: game-dlls
+ path: ~/bits-and-bops/Bits & Bops_Data/Managed
+
+ - name: Create BopVisualEffects.user.props
+ run: |
+ mkdir -p BopVisualEffects
+ cat > BopVisualEffects/BopVisualEffects.user.props << EOF
+
+
+ $HOME/bits-and-bops
+
+
+ EOF
+
- name: Restore
- run: dotnet restore BopVisualEffects.sln -p:SkipGameReferences=true
+ run: dotnet restore BopVisualEffects.sln
- name: Verify analyzer rules
run: dotnet format analyzers BopVisualEffects.sln --no-restore --verify-no-changes --verbosity minimal --exclude BopVisualEffects/obj
diff --git a/.github/workflows/release-new-version.yml b/.github/workflows/release-new-version.yml
index a0106a0..7e4e20b 100644
--- a/.github/workflows/release-new-version.yml
+++ b/.github/workflows/release-new-version.yml
@@ -23,6 +23,7 @@ jobs:
- name: Checkout master
uses: actions/checkout@v4
with:
+ token: ${{ secrets.RELEASE_TOKEN }}
fetch-depth: 0
ref: master
@@ -61,7 +62,7 @@ jobs:
git add BopVisualEffects/BopVisualEffects.csproj
if git diff --cached --quiet; then
echo "No version change detected." >&2
- exit 1
+ exit 0
fi
git commit -m "chore: bump version to v${VERSION}"
@@ -76,15 +77,24 @@ jobs:
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
+ setup-game-dlls:
+ uses: ./.github/workflows/setup-game-dlls.yml
+ secrets:
+ STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
+ STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
+
deploy-release-environment:
runs-on: ubuntu-latest
- needs: bump-version
+ needs:
+ - bump-version
+ - setup-game-dlls
environment: release
steps:
- name: Checkout bumped commit
uses: actions/checkout@v4
with:
+ token: ${{ secrets.RELEASE_TOKEN }}
fetch-depth: 0
ref: ${{ needs.bump-version.outputs.commit_sha }}
@@ -93,11 +103,28 @@ jobs:
with:
dotnet-version: 9.0.x
+ - name: Download game DLLs artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: game-dlls
+ path: ~/bits-and-bops/Bits & Bops_Data/Managed
+
+ - name: Create BopVisualEffects.user.props
+ run: |
+ mkdir -p BopVisualEffects
+ cat > BopVisualEffects/BopVisualEffects.user.props << EOF
+
+
+ $HOME/bits-and-bops
+
+
+ EOF
+
- name: Restore
- run: dotnet restore BopVisualEffects.sln -p:SkipGameReferences=true
+ run: dotnet restore BopVisualEffects.sln
- name: Build Release
- run: dotnet build BopVisualEffects.sln -c Release -p:SkipGameReferences=true --no-restore
+ run: dotnet build BopVisualEffects.sln -c Release --no-restore
- name: Package release artifact
run: |
@@ -128,12 +155,14 @@ jobs:
- name: Checkout master
uses: actions/checkout@v4
with:
+ token: ${{ secrets.RELEASE_TOKEN }}
fetch-depth: 0
ref: master
- name: Download built artifact
uses: actions/download-artifact@v4
with:
+ github-token: ${{ secrets.RELEASE_TOKEN }}
name: BopVisualEffects-v${{ needs.bump-version.outputs.version }}
path: dist
@@ -149,6 +178,7 @@ jobs:
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
+ token: ${{ secrets.RELEASE_TOKEN }}
tag_name: v${{ needs.bump-version.outputs.version }}
name: v${{ needs.bump-version.outputs.version }}
files: dist/*
diff --git a/.github/workflows/setup-game-dlls.yml b/.github/workflows/setup-game-dlls.yml
new file mode 100644
index 0000000..eb5428d
--- /dev/null
+++ b/.github/workflows/setup-game-dlls.yml
@@ -0,0 +1,74 @@
+name: Setup Game DLLs
+
+on:
+ workflow_call:
+ secrets:
+ STEAM_USERNAME:
+ required: true
+ STEAM_PASSWORD:
+ required: true
+
+jobs:
+ download-dlls:
+ runs-on: ubuntu-latest
+ permissions: {}
+
+ steps:
+ - name: Restore game DLLs from cache
+ id: cache
+ uses: actions/cache@v4
+ with:
+ path: ~/bits-and-bops/Bits & Bops_Data/Managed
+ key: bits-and-bops-1929290-managed-${{ runner.os }}-v1
+ restore-keys: bits-and-bops-1929290-managed-${{ runner.os }}-
+
+ - name: Download game DLLs using SteamCMD
+ env:
+ STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
+ STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
+ run: |
+ set -euo pipefail
+
+ # Skip download if DLLs are already cached
+ if [ -d "$HOME/bits-and-bops/Bits & Bops_Data/Managed" ] && [ -n "$(ls -A "$HOME/bits-and-bops/Bits & Bops_Data/Managed" 2>/dev/null)" ]; then
+ echo "Game DLLs found in cache, skipping download"
+ exit 0
+ fi
+
+ if [ -z "$STEAM_USERNAME" ] || [ -z "$STEAM_PASSWORD" ]; then
+ echo "Error: STEAM_USERNAME and STEAM_PASSWORD secrets are not set"
+ echo "Configure Steam credentials in repository secrets:"
+ echo "1. Go to Settings > Secrets and variables > Actions"
+ echo "2. Add STEAM_USERNAME and STEAM_PASSWORD"
+ echo ""
+ echo "IMPORTANT: Use a dedicated Steam account WITHOUT 2FA/Steam Guard enabled."
+ echo "SteamCMD cannot handle 2FA in automated environments."
+ exit 1
+ fi
+
+ # Install SteamCMD
+ mkdir -p ~/steamcmd
+ cd ~/steamcmd
+ curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
+
+ GAME_DIR="$HOME/bits-and-bops"
+ mkdir -p "$GAME_DIR"
+
+ # Download Bits & Bops (App ID: 1929290)
+ # NOTE: This will FAIL if the Steam account has 2FA/Steam Guard enabled
+ echo "Downloading Bits & Bops from Steam..."
+ ./steamcmd.sh +force_install_dir "$GAME_DIR" \
+ +login "$STEAM_USERNAME" "$STEAM_PASSWORD" \
+ +app_update 1929290 validate \
+ +quit
+
+ echo "Game DLLs downloaded successfully"
+ ls "$GAME_DIR/Bits & Bops_Data/Managed/" | wc -l
+ echo "DLLs found in managed directory"
+
+ - name: Upload game DLLs as artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: game-dlls
+ path: ~/bits-and-bops/Bits & Bops_Data/Managed
+ retention-days: 1
diff --git a/BopVisualEffects/BopVisualEffects.csproj b/BopVisualEffects/BopVisualEffects.csproj
index 19f78c8..c12a2eb 100644
--- a/BopVisualEffects/BopVisualEffects.csproj
+++ b/BopVisualEffects/BopVisualEffects.csproj
@@ -27,8 +27,6 @@
- true
- $(DefineConstants);SKIP_GAME_REFERENCES
$(BOP_GAME_ROOT)
$(GameRoot)/BepInEx
$(GameRoot)/BepInEx/plugins
@@ -40,24 +38,24 @@
-
-
+
+
$(UnityManagedDir)/UnityEngine.dll
false
-
+
$(UnityManagedDir)/UnityEngine.CoreModule.dll
false
-
+
$(UnityManagedDir)/UnityEngine.IMGUIModule.dll
false
-
+
$(UnityManagedDir)/UnityEngine.AssetBundleModule.dll
false
-
+
$(UnityManagedDir)/%(Identity).dll
false
@@ -72,7 +70,7 @@
Condition="Exists('Resources\bopvisualeffects_shaders_linux.assetbundle')" />
-
+
@@ -86,7 +84,7 @@
+ Condition="'$(BepInExPluginsDir)' != '' and Exists('$(BepInExPluginsDir)')">
diff --git a/BopVisualEffects/Stubs/CiGameTypeStubs.cs b/BopVisualEffects/Stubs/CiGameTypeStubs.cs
deleted file mode 100644
index 9a7e70a..0000000
--- a/BopVisualEffects/Stubs/CiGameTypeStubs.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-#if SKIP_GAME_REFERENCES
-#pragma warning disable CA1050 // Declare types in namespaces — stubs mirror global-namespace game types
-#pragma warning disable CA1051 // Do not declare visible instance fields — stubs mirror Unity-serialized public fields
-#pragma warning disable CA1822 // Mark members as static — stubs must match real instance method signatures
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-
-public enum SceneKey
-{
- Unknown = 0,
- MixtapeEditor = 1
-}
-
-public sealed class MixtapeEventTemplate
-{
- public string dataModel = string.Empty;
- public float length;
- public bool resizable;
- public Dictionary properties = [];
-}
-
-public static class MixtapeEventTemplates
-{
- public static readonly Dictionary> entities = [];
-}
-
-public sealed class Entity
-{
- public string dataModel = string.Empty;
- public float length;
- public float beat;
- public readonly Dictionary properties = [];
-
- public float GetFloat(string key)
- {
- if (!properties.TryGetValue(key, out object? value) || value is null)
- return 0f;
-
- return value switch
- {
- float floatValue => floatValue,
- double doubleValue => (float)doubleValue,
- int intValue => intValue,
- _ => 0f
- };
- }
-}
-
-public sealed class MixtapeLoaderCustom : MonoBehaviour
-{
- public readonly Scheduler scheduler = new();
- public JukeboxScript? jukebox;
-}
-
-public sealed class Scheduler
-{
- public void Schedule(float beat, Action? callback)
- {
- callback?.Invoke();
- }
-}
-
-public sealed class JukeboxScript : MonoBehaviour
-{
- public float CurrentBeat { get; set; }
-}
-
-public sealed class GameplayScript : MonoBehaviour
-{
- public MonoBehaviour? cameraScript;
-}
-
-public sealed class MixtapeEditorScript
-{
-}
-
-public static class TempoSceneManager
-{
- public static SceneKey GetActiveSceneKey()
- {
- return SceneKey.Unknown;
- }
-}
-#endif