From f426ecaaf9de1e597eeec61ca31dae9f008b8d27 Mon Sep 17 00:00:00 2001 From: js6pak Date: Sat, 12 Jun 2021 22:05:34 +0200 Subject: [PATCH] Reactor branded CI --- .github/workflows/main.yml | 29 +++++++++++++++++++++++++ BepInEx.Shared/BepInEx.Shared.projitems | 2 +- build.cake | 23 ++++++++++++++------ 3 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..18b03cd8 --- /dev/null +++ b/.github/workflows/main.yml @@ -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 diff --git a/BepInEx.Shared/BepInEx.Shared.projitems b/BepInEx.Shared/BepInEx.Shared.projitems index c90c02a8..0ea36935 100644 --- a/BepInEx.Shared/BepInEx.Shared.projitems +++ b/BepInEx.Shared/BepInEx.Shared.projitems @@ -5,7 +5,7 @@ true E312EFD4-47ED-4DCE-B279-6B0EE314989F Copyright © 2020 BepInEx Team - 6.0.0 + 6.0.0-reactor BepInEx.Shared diff --git a/build.cake b/build.cake index 527ed51f..5574a757 100644 --- a/build.cake +++ b/build.cake @@ -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 = ""; @@ -50,7 +50,7 @@ Task("Build") { var bepinExProperties = Directory("./BepInEx.Shared"); - buildVersion = FindRegexMatchGroupInFile(bepinExProperties + File("BepInEx.Shared.projitems"), @"\([0-9]+\.[0-9]+\.[0-9]+)\<\/Version\>", 1, System.Text.RegularExpressions.RegexOptions.None).Value; + buildVersion = FindRegexMatchGroupInFile(bepinExProperties + File("BepInEx.Shared.projitems"), @"\([0-9]+\.[0-9]+\.[0-9]+)-reactor\<\/Version\>", 1, System.Text.RegularExpressions.RegexOptions.None).Value; var buildSettings = new DotNetCoreBuildSettings { Configuration = "Release", @@ -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); @@ -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); @@ -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") @@ -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") { @@ -275,4 +284,4 @@ Task("Pack") } }); -RunTarget(target); \ No newline at end of file +RunTarget(target);