Skip to content

Commit

Permalink
Merge pull request #23 from Frieren-Violet/dev
Browse files Browse the repository at this point in the history
.github/preProcess
  • Loading branch information
Jack15678 authored Oct 19, 2024
2 parents dc7b75e + 3148d44 commit 00dd55f
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 7 deletions.
51 changes: 51 additions & 0 deletions .github/preProcess/AvaloniaEnvConfig.csx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System.Xml;
using System.IO;

string path = @"D:\a\THUAI8\";
Visit(new DirectoryInfo(path));

void Visit(DirectoryInfo root)
{
foreach (var file in root.EnumerateFiles())
{
if (file.Name.EndsWith("csproj"))
{
ChangeFile(file.FullName);
}
}
foreach (var dir in root.EnumerateDirectories())
{
Visit(dir);
}
}

void ChangeFile(string path)
{
var document = new XmlDocument();
document.Load(path);
var projectNode = document.DocumentElement;
if (projectNode != null)
{
var propertyGroup = document.CreateElement("PropertyGroup", projectNode.NamespaceURI);

var optimize = document.CreateElement("Optimize", projectNode.NamespaceURI);
optimize.InnerText = "true";
propertyGroup.AppendChild(optimize);

var serverGc = document.CreateElement("ServerGarbageCollection", projectNode.NamespaceURI);
serverGc.InnerText = "true";
propertyGroup.AppendChild(serverGc);

var concurrentGc = document.CreateElement("ConcurrentGarbageCollection", projectNode.NamespaceURI);
concurrentGc.InnerText = "true";
propertyGroup.AppendChild(concurrentGc);

var tieredCompilation = document.CreateElement("TieredCompilation", projectNode.NamespaceURI);
tieredCompilation.InnerText = "true";
propertyGroup.AppendChild(tieredCompilation);

projectNode.AppendChild(propertyGroup);
}

document.Save(path);
}
34 changes: 28 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
branches: [dev, main, master]
jobs:
dotnet-build:
dotnet-build-logic:
if: true
runs-on: windows-latest
steps:
Expand All @@ -14,12 +14,34 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x



- name: Build Logic
run: dotnet build "./logic/logic.sln" -c Release

- name: Build Installer
run: dotnet build "./installer/installer.sln" -c Release


dotnet-build-install:
if: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build Installer
run: dotnet build "./installer/installer.sln" -c Release


dotnet-build-playback:
if: ture
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build Playback
run: dotnet build "./playback/playback.sln" -c Release
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
- name: Check Playback
run: |
dotnet restore "./playback/playback.sln"
dotnet format "./playback/playback.sln" --severity error --no-restore --verify-no-changes
dotnet format "./playback/playback.sln" --severity error --no-restore --verify-no-changes

0 comments on commit 00dd55f

Please sign in to comment.