Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

Commit

Permalink
Reactor branded CI
Browse files Browse the repository at this point in the history
  • Loading branch information
js6pak committed Jun 20, 2021
1 parent 1b852cd commit f426eca
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 8 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Cake

on:
push:
branches: [ reactor ]
pull_request:
branches: [ reactor ]

jobs:
build:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.301

- name: Cake Action
uses: cake-build/cake-action@v1

- uses: actions/upload-artifact@v2
with:
name: BepInEx-reactor
path: bin/dist/BepInEx_UnityIL2CPP_x86*.zip
2 changes: 1 addition & 1 deletion BepInEx.Shared/BepInEx.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<HasSharedItems>true</HasSharedItems>
<SharedGUID>E312EFD4-47ED-4DCE-B279-6B0EE314989F</SharedGUID>
<Copyright>Copyright © 2020 BepInEx Team</Copyright>
<Version>6.0.0</Version>
<Version>6.0.0-reactor</Version>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>BepInEx.Shared</Import_RootNamespace>
Expand Down
23 changes: 16 additions & 7 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#addin nuget:?package=Cake.Json&version=6.0.1
#addin nuget:?package=Newtonsoft.Json&version=13.0.1

var target = Argument("target", "Build");
var isBleedingEdge = Argument("bleeding_edge", false);
var buildId = Argument("build_id", 0);
var target = Argument("target", "Pack");
var buildId = Argument("build_id", EnvironmentVariable("GITHUB_RUN_NUMBER", 0));
var isBleedingEdge = Argument("bleeding_edge", buildId != 0);
var lastBuildCommit = Argument("last_build_commit", "");

var buildVersion = "";
Expand Down Expand Up @@ -50,7 +50,7 @@ Task("Build")
{
var bepinExProperties = Directory("./BepInEx.Shared");
buildVersion = FindRegexMatchGroupInFile(bepinExProperties + File("BepInEx.Shared.projitems"), @"\<Version\>([0-9]+\.[0-9]+\.[0-9]+)\<\/Version\>", 1, System.Text.RegularExpressions.RegexOptions.None).Value;
buildVersion = FindRegexMatchGroupInFile(bepinExProperties + File("BepInEx.Shared.projitems"), @"\<Version\>([0-9]+\.[0-9]+\.[0-9]+)-reactor\<\/Version\>", 1, System.Text.RegularExpressions.RegexOptions.None).Value;
var buildSettings = new DotNetCoreBuildSettings {
Configuration = "Release",
Expand All @@ -69,9 +69,13 @@ Task("Build")
buildSettings.MSBuildSettings.Properties["AssemblyVersion"] = new[] { buildVersion + "." + buildId };
buildVersion += "-be." + buildId;
buildVersion += "-reactor." + buildId;
buildSettings.MSBuildSettings.Properties["Version"] = new[] { buildVersion };
}
else
{
buildVersion += "-reactor";
}
DotNetCoreBuild("./BepInEx.Unity/BepInEx.Unity.csproj", buildSettings);
Expand Down Expand Up @@ -114,6 +118,7 @@ Task("DownloadDependencies")
var monoPath = Directory("./bin/doorstop/mono");
var monoX64Path = doorstopPath + File("mono_x64.zip");
var monoX86Path = doorstopPath + File("mono_x86.zip");
var baseLibs = doorstopPath + File("2020.2.6.zip");
CreateDirectory(monoPath);
DownloadFile($"https://github.com/BepInEx/mono/releases/download/{MONO_VER}/mono-x64.zip", monoX64Path);
Expand All @@ -123,6 +128,9 @@ Task("DownloadDependencies")
ZipUncompress(monoX64Path, monoPath + Directory("x64"));
ZipUncompress(monoX86Path, monoPath + Directory("x86"));
DownloadFile("https://raw.githubusercontent.com/js6pak/Unity-Runtime-Libraries/master/2020.2.6.zip", baseLibs);
ZipUncompress(baseLibs, doorstopPath + Directory("BaseLibs"));
});

Task("MakeDist")
Expand Down Expand Up @@ -182,13 +190,14 @@ Task("MakeDist")
if (copyMono)
{
CopyDirectory("./bin/doorstop/mono/" + arch + "/mono", Directory(distArchDir) + Directory("mono"));
CopyDirectory("./bin/doorstop/BaseLibs", Directory(distArchDir) + Directory("BepInEx") + Directory("unity-libs"));
}
}
CopyFiles("./bin/" + Directory(originDir) + "/*.*", Directory(bepinDir) + Directory("core"));
FileWriteText(distArchDir + File("changelog.txt"), changelog);
// FileWriteText(distArchDir + File("changelog.txt"), changelog);
if (platform == "NetLauncher")
{
Expand Down Expand Up @@ -275,4 +284,4 @@ Task("Pack")
}
});

RunTarget(target);
RunTarget(target);

0 comments on commit f426eca

Please sign in to comment.