pipeline { agent any options { buildDiscarder ( logRotator( numToKeepStr: '5' ) ) } stages { stage("Build on Linux") { agent { label 'linux' } steps { script { sh ''' dotnet restore dotnet publish ForgeCore.csproj --nologo -c Release --self-contained true /p:PublishSingleFile=true ''' } } post { always { archiveArtifacts artifacts: "bin/Release/net8.0/linux-x64/publish/ForgeCore" cleanWs() } } } stage("Build API DLL") { agent { label 'linux' } steps { script { sh ''' cd ForgeCoreAPI dotnet new sln -n ForgeCoreAPI dotnet sln ForgeCoreAPI.sln add ForgeCoreAPI.csproj dotnet build -c Release ''' } } post { always { archiveArtifacts artifacts: "ForgeCoreAPI/bin/Release/net8.0/ForgeCoreAPI.dll" cleanWs() } } } } }