Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/on-push-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ jobs:
with:
dotnet-version: 10.0.100

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.0

- name: Self Build
run: |
echo "# Self Build" >> $GITHUB_STEP_SUMMARY
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/on-push-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ jobs:
with:
dotnet-version: 10.0.100

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.0

- name: Build & Publish
run: make publish-all config=Release version=${{ env.BUILD_VERSION }}

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ usage:
# | _| `._____||_______||_______||_______/__/ \__\ |_______/ |_______|
#

publish:
publish: webui
dotnet publish -c $(config) -p:Version=$(version) -o $(PWD)/.out/dotnet src/Terrabuild
dotnet pack -c $(config) -p:Version=$(version) -o .out

publish-darwin:
publish-darwin: webui
dotnet publish -c $(config) -r osx-x64 -p:PublishSingleFile=true --self-contained -p:Version=$(version) -p:IncludeNativeLibrariesForSelfExtract=true -o $(PWD)/.out/darwin/x64 src/Terrabuild
dotnet publish -c $(config) -r osx-arm64 -p:PublishSingleFile=true --self-contained -p:Version=$(version) -p:IncludeNativeLibrariesForSelfExtract=true -o $(PWD)/.out/darwin/arm64 src/Terrabuild

publish-linux:
publish-linux: webui
dotnet publish -c $(config) -r linux-x64 -p:PublishSingleFile=true --self-contained -p:Version=$(version) -p:IncludeNativeLibrariesForSelfExtract=true -o $(PWD)/.out/linux/x64 src/Terrabuild
dotnet publish -c $(config) -r linux-arm64 -p:PublishSingleFile=true --self-contained -p:Version=$(version) -p:IncludeNativeLibrariesForSelfExtract=true -o $(PWD)/.out/linux/arm64 src/Terrabuild

publish-windows:
publish-windows: webui
dotnet publish -c $(config) -r win-x64 -p:PublishSingleFile=true --self-contained -p:Version=$(version) -p:IncludeNativeLibrariesForSelfExtract=true -o $(PWD)/.out/windows/x64 src/Terrabuild
dotnet publish -c $(config) -r win-arm64 -p:PublishSingleFile=true --self-contained -p:Version=$(version) -p:IncludeNativeLibrariesForSelfExtract=true -o $(PWD)/.out/windows/arm64 src/Terrabuild

Expand Down
8 changes: 6 additions & 2 deletions src/Terrabuild/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let processCommandLine (parser: ArgumentParser<TerrabuildArgs>) (result: ParseRe

let logFile name = FS.combinePath launchDir $"terrabuild-debug.{name}"

if debug then
if log || debug then
let loggerBuilder = LoggerConfiguration().WriteTo.File(logFile "log")
let loggerBuilder =
if debug then loggerBuilder.MinimumLevel.Debug()
Expand Down Expand Up @@ -301,7 +301,11 @@ let processCommandLine (parser: ArgumentParser<TerrabuildArgs>) (result: ParseRe
runTarget options

let graph (graphArgs: ParseResults<GraphArgs>) =
GraphServer.start graphArgs
"Press Ctrl+C to exit graph server mode." |> Terminal.writeLine
Terminal.flush()
Console.SetOut(IO.TextWriter.Null)
Console.SetError(IO.TextWriter.Null)
GraphServer.start graphArgs (log || debug) debug

let logs (logsArgs: ParseResults<LogsArgs>) =
let targets = logsArgs.GetResult(LogsArgs.Target) |> Seq.map String.toLower
Expand Down
1 change: 1 addition & 0 deletions src/Terrabuild/Terrabuild.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<PackageReference Include="FSharp.SystemTextJson" Version="1.4.36" />
<PackageReference Include="Argu" Version="6.2.5" />
<PackageReference Include="Sentry" Version="5.16.2" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="DotNetEnv" Version="3.1.1" />
<PackageReference Include="LibGit2Sharp" Version="0.31.0" />
Expand Down
9 changes: 8 additions & 1 deletion src/Terrabuild/Web/GraphServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ open Microsoft.AspNetCore.Http
open Microsoft.Extensions.FileProviders
open Microsoft.Extensions.Hosting
open Microsoft.Extensions.DependencyInjection
open Microsoft.Extensions.Logging
open Serilog
open Collections
open Environment
open CLI
Expand Down Expand Up @@ -256,7 +258,7 @@ let private startBuildProcess (workspace: string) (request: BuildRequest) (logSt
Ok proc.Id
)

let start (graphArgs: ParseResults<GraphArgs>) =
let start (graphArgs: ParseResults<GraphArgs>) (logEnabled: bool) (debugEnabled: bool) =
let workspace =
graphArgs.TryGetResult(CLI.GraphArgs.Workspace)
|> resolveWorkspace
Expand All @@ -280,6 +282,11 @@ let start (graphArgs: ParseResults<GraphArgs>) =
let port = graphArgs.TryGetResult(GraphArgs.Port) |> Option.defaultValue 5179
let url = $"http://127.0.0.1:{port}"
let builder = WebApplication.CreateBuilder()
builder.Logging.ClearProviders() |> ignore
if debugEnabled then
builder.Logging.SetMinimumLevel(LogLevel.Debug) |> ignore
if logEnabled then
builder.Logging.AddSerilog(Log.Logger, dispose = false) |> ignore
builder.Services.AddCors() |> ignore
builder.WebHost.UseUrls(url) |> ignore

Expand Down