diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
new file mode 100644
index 0000000..6cf141e
--- /dev/null
+++ b/.config/dotnet-tools.json
@@ -0,0 +1,12 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "cake.tool": {
+ "version": "1.1.0",
+ "commands": [
+ "dotnet-cake"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 74bda7a..32cfd20 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,7 +1,6 @@
name: CI
-on:
- push:
+on: [ "push", "pull_request" ]
jobs:
build:
@@ -15,19 +14,19 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
- dotnet-version: 5.0.101
+ dotnet-version: 5.0.300
- - name: Cake Action
- run: sh build.sh
- env:
- STEAM: ${{ secrets.STEAM }}
+ - name: Run the Cake script
+ uses: cake-build/cake-action@v1
+ with:
+ verbosity: Diagnostic
- uses: actions/upload-artifact@v2
with:
name: Reactor.dll
- path: Reactor/bin/Release/netstandard2.1/reobfuscated/Reactor-*.dll
+ path: Reactor/bin/Release/netstandard2.1/Reactor.dll
- uses: actions/upload-artifact@v2
with:
name: Reactor.Debugger.dll
- path: Reactor.Debugger/bin/Release/netstandard2.1/reobfuscated/Reactor.Debugger-*.dll
+ path: Reactor.Debugger/bin/Release/netstandard2.1/Reactor.Debugger.dll
diff --git a/.gitignore b/.gitignore
index 4867c4e..e934bbe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@ obj/
riderModule.iml
/_ReSharper.Caches/
.idea
+/tools
+.vscode
diff --git a/AmongUs.props b/AmongUs.props
index eb370e1..2cf081b 100644
--- a/AmongUs.props
+++ b/AmongUs.props
@@ -1,18 +1,23 @@
-
- 2021.4.14s
- $(DefineConstants);STEAM
+
+ Steam
+ 2021.5.25.2s
+ 2021.5.10i
-
- NuclearPowered/Mappings:0.4.0
+
+ $(GamePlatform)
+
+
+
+ Github
-
+
-
-
+
+
diff --git a/Reactor.sln b/Reactor.sln
index 9dcf9fc..c9eb616 100644
--- a/Reactor.sln
+++ b/Reactor.sln
@@ -3,10 +3,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Reactor", "Reactor\Reactor.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Reactor.Debugger", "Reactor.Debugger\Reactor.Debugger.csproj", "{68589B4D-9EF5-40DD-8D6D-10977ED07259}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build", "build\Build.csproj", "{58AC4924-AC3D-45EA-80D7-E9F860FD1DD2}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{E2F4DAFA-E98C-4A7D-BA47-AAB0271A769D}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Reactor.Example", "Reactor.Example\Reactor.Example.csproj", "{26A83466-26FE-4383-A35C-B8629902F909}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Reactor.Shared", "Reactor.Shared\Reactor.Shared.shproj", "{8C1EEFE9-EF8A-47C4-810E-6D9BA1E7218B}"
@@ -25,14 +21,11 @@ Global
{68589B4D-9EF5-40DD-8D6D-10977ED07259}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68589B4D-9EF5-40DD-8D6D-10977ED07259}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68589B4D-9EF5-40DD-8D6D-10977ED07259}.Release|Any CPU.Build.0 = Release|Any CPU
- {58AC4924-AC3D-45EA-80D7-E9F860FD1DD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {58AC4924-AC3D-45EA-80D7-E9F860FD1DD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26A83466-26FE-4383-A35C-B8629902F909}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{26A83466-26FE-4383-A35C-B8629902F909}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26A83466-26FE-4383-A35C-B8629902F909}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26A83466-26FE-4383-A35C-B8629902F909}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {58AC4924-AC3D-45EA-80D7-E9F860FD1DD2} = {E2F4DAFA-E98C-4A7D-BA47-AAB0271A769D}
EndGlobalSection
EndGlobal
diff --git a/Reactor/Reactor.csproj b/Reactor/Reactor.csproj
index 14a4cff..01d810f 100644
--- a/Reactor/Reactor.csproj
+++ b/Reactor/Reactor.csproj
@@ -3,7 +3,7 @@
netstandard2.1
latest
- 0.4.0
+ 1.0.0
dev
Core mod and API for Among Us
NuclearPowered
diff --git a/build.cake b/build.cake
new file mode 100644
index 0000000..3bbd153
--- /dev/null
+++ b/build.cake
@@ -0,0 +1,34 @@
+var target = Argument("target", "Build");
+
+var buildId = EnvironmentVariable("GITHUB_RUN_NUMBER");
+
+var @ref = EnvironmentVariable("GITHUB_REF");
+const string prefix = "refs/tags/";
+var tag = !string.IsNullOrEmpty(@ref) && @ref.StartsWith(prefix) ? @ref.Substring(prefix.Length) : null;
+
+Task("Build")
+ .Does(() =>
+{
+ var settings = new DotNetCoreBuildSettings
+ {
+ Configuration = "Release",
+ MSBuildSettings = new DotNetCoreMSBuildSettings()
+ };
+
+ if (tag != null)
+ {
+ settings.MSBuildSettings.Properties["Version"] = new[] { tag };
+ }
+ else if (buildId != null)
+ {
+ settings.VersionSuffix = "ci." + buildId;
+ }
+
+ foreach (var gamePlatform in new[] { "Steam", "Itch" })
+ {
+ settings.MSBuildSettings.Properties["GamePlatform"] = new[] { gamePlatform };
+ DotNetCoreBuild(".", settings);
+ }
+});
+
+RunTarget(target);
diff --git a/build.ps1 b/build.ps1
deleted file mode 100644
index a707719..0000000
--- a/build.ps1
+++ /dev/null
@@ -1,2 +0,0 @@
-dotnet run --project build/Build.csproj -- $args
-exit $LASTEXITCODE;
\ No newline at end of file
diff --git a/build.sh b/build.sh
index dfd6b85..31be886 100644
--- a/build.sh
+++ b/build.sh
@@ -1 +1,12 @@
-dotnet run --project ./build/Build.csproj -- "$@"
+#!/usr/bin/env bash
+set -euox pipefail
+
+cd "$(dirname "${BASH_SOURCE[0]}")"
+
+export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
+export DOTNET_CLI_TELEMETRY_OPTOUT=1
+export DOTNET_NOLOGO=1
+
+dotnet tool restore
+
+dotnet cake "$@"
diff --git a/build/Build.csproj b/build/Build.csproj
deleted file mode 100644
index be07a1e..0000000
--- a/build/Build.csproj
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- Exe
- net5.0
- $(MSBuildProjectDirectory)/..
-
-
-
-
-
-
-
-
-
diff --git a/build/Program.cs b/build/Program.cs
deleted file mode 100644
index 4087495..0000000
--- a/build/Program.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-using System.IO;
-using System.Threading.Tasks;
-using AssemblyUnhollower;
-using Cake.Common;
-using Cake.Common.Diagnostics;
-using Cake.Common.IO;
-using Cake.Common.Net;
-using Cake.Common.Tools.DotNetCore;
-using Cake.Common.Tools.DotNetCore.Build;
-using Cake.Core;
-using Cake.Frosting;
-using DepotDownloader;
-
-public static class Program
-{
- public static int Main(string[] args)
- {
- return new CakeHost()
- .UseContext()
- .Run(args);
- }
-}
-
-public class BuildContext : FrostingContext
-{
- public string TempPath { get; } = "bin/temp";
- public string AmongUsPath { get; } = "bin/Among Us";
-
- public BuildContext(ICakeContext context) : base(context)
- {
- context.CreateDirectory(TempPath);
- context.CreateDirectory(AmongUsPath);
- }
-}
-
-[TaskName("SetupAmongUs")]
-public sealed class SetupAmongUsTask : AsyncFrostingTask
-{
- public const uint AppId = 945360;
- public const uint DepotId = 945361;
- public const ulong ManifestId = 1328515537648622656; // 2021.4.14s
-
- public override async Task RunAsync(BuildContext context)
- {
- AccountSettingsStore.LoadFromFile("account.config");
- var steam = context.EnvironmentVariable("STEAM", null).Split(":");
-
- context.Information("Logging into steam");
- ContentDownloader.InitializeSteam3(steam[0], steam[1]);
-
- ContentDownloader.Config.InstallDirectory = context.AmongUsPath;
-
- context.Information("Downloading the game from steam");
- await ContentDownloader.DownloadAppAsync(AppId, DepotId, ManifestId);
- ContentDownloader.ShutdownSteam3();
-
- var bepinexZip = context.DownloadFile("https://github.com/NuclearPowered/BepInEx/releases/download/6.0.0-reactor.18%2Bstructfix/BepInEx-6.0.0-reactor.18+structfix.zip");
- context.Unzip(bepinexZip, Path.Combine(context.AmongUsPath));
- }
-}
-
-[TaskName("GenerateProxyAssembly")]
-[IsDependentOn(typeof(SetupAmongUsTask))]
-public sealed class GenerateProxyAssemblyTask : FrostingTask
-{
- public override void Run(BuildContext context)
- {
- var dumperConfig = new Il2CppDumper.Config
- {
- GenerateStruct = false,
- GenerateDummyDll = true
- };
-
- context.Information("Generating Il2CppDumper intermediate assemblies");
-
- var gameAssemblyPath = Path.Combine(context.AmongUsPath, "GameAssembly.dll");
-
- Il2CppDumper.Il2CppDumper.PerformDump(
- gameAssemblyPath,
- Path.Combine(context.AmongUsPath, "Among Us_Data", "il2cpp_data", "Metadata", "global-metadata.dat"),
- context.TempPath, dumperConfig, context.Debug
- );
-
- context.Information("Executing Il2CppUnhollower generator");
-
- UnhollowerBaseLib.LogSupport.InfoHandler += context.Information;
- UnhollowerBaseLib.LogSupport.WarningHandler += context.Warning;
- UnhollowerBaseLib.LogSupport.TraceHandler += context.Debug;
- UnhollowerBaseLib.LogSupport.ErrorHandler += context.Error;
-
- var unhollowerOptions = new UnhollowerOptions
- {
- GameAssemblyPath = gameAssemblyPath,
- MscorlibPath = Path.Combine(context.AmongUsPath, "mono", "Managed", "mscorlib.dll"),
- SourceDir = Path.Combine(context.TempPath, "DummyDll"),
- OutputDir = Path.Combine(context.AmongUsPath, "BepInEx", "unhollowed"),
- UnityBaseLibsDir = Path.Combine(context.AmongUsPath, "BepInEx", "unity-libs"),
- NoCopyUnhollowerLibs = true
- };
-
- AssemblyUnhollower.Program.Main(unhollowerOptions);
- }
-}
-
-[TaskName("Clean")]
-public sealed class CleanTask : FrostingTask
-{
- public override void Run(BuildContext context)
- {
- context.CleanDirectory("bin");
- }
-}
-
-[TaskName("Build")]
-[IsDependentOn(typeof(CleanTask))]
-[IsDependentOn(typeof(GenerateProxyAssemblyTask))]
-public sealed class BuildTask : FrostingTask
-{
- private void Build(BuildContext context, string project)
- {
- var buildId = context.EnvironmentVariable("GITHUB_RUN_NUMBER", null);
-
- context.DotNetCoreBuild(project, new DotNetCoreBuildSettings
- {
- Configuration = "Release",
- VersionSuffix = buildId == null ? "dev" : "ci." + buildId,
- EnvironmentVariables =
- {
- ["GamePlatform"] = "Steam",
- ["AmongUs"] = Path.GetFullPath(context.AmongUsPath)
- }
- });
- }
-
- public override void Run(BuildContext context)
- {
- Build(context, "Reactor/Reactor.csproj");
- Build(context, "Reactor.Debugger/Reactor.Debugger.csproj");
- }
-}
-
-[IsDependentOn(typeof(BuildTask))]
-public sealed class Default : FrostingTask
-{
-}