Skip to content

Commit

Permalink
Try to build docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore committed Sep 10, 2023
1 parent f37af88 commit c0c353d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/gameci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,17 @@ jobs:
mkdir .github/ProjectRoot/Packages/nadena.dev.ndmf -p
mv [^P]* .github/ProjectRoot/Packages/nadena.dev.ndmf
mv .github/ProjectRoot/* .
mv 'Packages/nadena.dev.ndmf/UnitTests~' 'Packages/nadena.dev.ndmf/UnitTests'
- uses: anatawa12/sh-actions/resolve-vpm-packages@master

- uses: game-ci/unity-builder@v3
id: docgen
with:
buildMethod: DocsBuilder.BuildDocs
env:
# meh, just a personal license...
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

- uses: game-ci/unity-test-runner@v3
id: gameci
Expand Down
29 changes: 29 additions & 0 deletions UnitTests~/DocsBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Diagnostics;
using Microsoft.Unity.VisualStudio.Editor;
using UnityEditor;

public static class DocsBuilder
{
public static void BuildDocs()
{
ProjectGeneration projectGeneration = new ProjectGeneration();
AssetDatabase.Refresh();
projectGeneration.GenerateAndWriteSolutionAndProjects();

RunProcess("dotnet tool update -g docfx");
RunProcess("ls -l");
}

private static void RunProcess(string command)
{
System.Console.Error.WriteLine("=== Running command: " + command + " ===");
var process = Process.Start(command);
process.WaitForExit();

if (process.ExitCode != 0)
{
throw new Exception("Process failed: " + command + " - with error code " + process.ExitCode);
}
}
}
11 changes: 11 additions & 0 deletions UnitTests~/DocsBuilder.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c0c353d

Please sign in to comment.