mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-08-01 16:28:36 -04:00
Allows us to get rid of a ton of abstraction in SboxBuild, and gets rid of a lot of GitHub API plumbing. I feel like now that our workflows are more complex it's nicer to just use GitHub directly rather than having our own pipeline abstraction in SboxBuild. This way we get nicer logging and error reporting, which we can\t achieve through GitHub API.
37 lines
888 B
C#
37 lines
888 B
C#
using static Facepunch.Constants;
|
|
|
|
namespace Facepunch.Steps;
|
|
|
|
internal class BuildContent
|
|
{
|
|
internal ExitCode Run()
|
|
{
|
|
try
|
|
{
|
|
string rootDir = Directory.GetCurrentDirectory();
|
|
string gameDir = Path.Combine( rootDir, "game" );
|
|
string contentBuilderPath = Path.Combine( gameDir, "bin", "win64", "contentbuilder.exe" );
|
|
|
|
// Verify content builder exists
|
|
if ( !File.Exists( contentBuilderPath ) )
|
|
{
|
|
Log.Error( $"Error: Content builder executable not found at {contentBuilderPath}" );
|
|
return ExitCode.Failure;
|
|
}
|
|
|
|
bool success = Utility.RunProcess( contentBuilderPath, "-b", gameDir );
|
|
|
|
if ( !success )
|
|
return ExitCode.Failure;
|
|
|
|
Log.Info( "Content building completed successfully!" );
|
|
return ExitCode.Success;
|
|
}
|
|
catch ( Exception ex )
|
|
{
|
|
Log.Error( $"Content building failed with error: {ex}" );
|
|
return ExitCode.Failure;
|
|
}
|
|
}
|
|
}
|