From 3a6548224177fd837d6b8364e3d77c60411f7108 Mon Sep 17 00:00:00 2001 From: bd_ Date: Sun, 10 Sep 2023 22:05:40 +0900 Subject: [PATCH] ci: More work on docs build --- .github/ProjectRoot/build-docs.sh | 8 ++++++++ UnitTests~/DocsBuilder.cs | 16 ++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 .github/ProjectRoot/build-docs.sh diff --git a/.github/ProjectRoot/build-docs.sh b/.github/ProjectRoot/build-docs.sh new file mode 100644 index 0000000..d22e61c --- /dev/null +++ b/.github/ProjectRoot/build-docs.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -euxo pipefail + +apt-get -y update +apt-get -y install dotnet7 +dotnet tool update -g docfx +ls -l /root/.dotnet/tools \ No newline at end of file diff --git a/UnitTests~/DocsBuilder.cs b/UnitTests~/DocsBuilder.cs index a8107e0..1f6e8cb 100644 --- a/UnitTests~/DocsBuilder.cs +++ b/UnitTests~/DocsBuilder.cs @@ -10,17 +10,21 @@ public static void BuildDocs() ProjectGeneration projectGeneration = new ProjectGeneration(); AssetDatabase.Refresh(); projectGeneration.GenerateAndWriteSolutionAndProjects(); - - RunProcess("apt-get -y update"); - RunProcess("apt-get -y install dotnet7"); - RunProcess("dotnet tool update -g docfx"); - RunProcess("ls -l /root/.dotnet/tools"); + + try + { + RunProcess("./build-docs.sh"); + } + catch (Exception e) + { + System.Console.Error.WriteLine("Failed to build docs: " + e); + } } private static void RunProcess(string command) { System.Console.Error.WriteLine("=== Running command: " + command + " ==="); - var process = Process.Start(command); + var process = Process.Start("/bin/sh", "-c command"); process.WaitForExit(); if (process.ExitCode != 0)