Skip to content

Build in the ksp-ci container, with SDK-style projects - #197

Merged
sarbian merged 2 commits into
masterfrom
ci/ksp-ci-image
Nov 29, 2026
Merged

sarbian merged 2 commits into
masterfrom
ci/ksp-ci-image

Conversation

@sarbian

@sarbian sarbian commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

The build job now runs in the ghcr.io/sarbian/ksp-ci container (from sarbian/KSP_CI), which has Mono and the .NET SDK 10.0, instead of installing Mono from the mono-project repository on every run. That repository only had focal packages, which kept the job pinned to ubuntu-24.04; it is back on ubuntu-latest.

To build with the SDK the way MechJeb2 does, the four projects are converted to SDK style.

Projects

  • ModuleManager, TestUtils, ModuleManagerTests and TestUtilsTests are SDK-style net471 projects. The packages.config files are replaced by PackageReference, at the same versions.
  • Directory.Build.targets (modelled on MechJeb2's) adds Microsoft.NETFramework.ReferenceAssemblies.net471, so the projects build with the .NET SDK on any OS, and makes ReferencePath an assembly search path for the bare KSP/Unity references. Locally ReferencePath still comes from each .csproj.user.
  • Kept as before: the same source files (the SDK's globbing picks up exactly what the Compile lists had), LangVersion 8.0, the hand-written AssemblyInfo.cs (GenerateAssemblyInfo false, so create-release.yml's version stamping is unchanged), bin/<Configuration>/ output paths and DebugType.
  • The post-build copy into KSP (copy_build.sh) is now a CopyBuild target, turned off with -p:CopyBuild=false (CI used to pass -p:PostBuildEvent=).
  • CopyLocalFalse is gone: its targets were never imported, so it did nothing.

Workflow

build.yml is dotnet restore and dotnet msbuild in the container, as in MechJeb2. The only download left is KSPLibs.

For review

  • The PR build (run 46257180059) built all four projects with no warnings. Its ModuleManager.dll has the same assembly references, embedded resource, types (130), methods (606) and assembly attributes as the v4.3.0 release DLL. It is 512 bytes larger: a deterministic-build debug directory entry and the newer compiler's code layout.
  • Opening the solution needs an IDE that loads SDK-style projects (any recent Visual Studio or Rider).
  • Two commits: the project conversion, then the workflow change.

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Build Artifact

ModuleManager-90f61c2.zip (built from a667088)

The four csprojs were legacy (non-SDK) projects with packages.config, which
the .NET SDK can not restore. As SDK-style net471 projects, dotnet restore
fetches their packages, and Directory.Build.targets adds the net471 reference
assemblies package (Microsoft.NETFramework.ReferenceAssemblies.net471), as in
MechJeb2, so they build with the .NET SDK on any OS.

Kept as before: the sources (the SDK picks up the same files the Compile lists
had), LangVersion 8.0, the hand-written AssemblyInfo.cs (GenerateAssemblyInfo
false), bin/<Configuration>/ output paths, DebugType, and the bare KSP
references, which Directory.Build.targets resolves through ReferencePath (from
.csproj.user locally, from the command line in CI). The post-build copy into
KSP (copy_build.sh) is now a target, turned off with -p:CopyBuild=false.

CopyLocalFalse is gone: its targets were never imported, so it did nothing.
The built ModuleManager.dll has the same assembly references, resources,
types and methods as the v4.3.0 release's.
The build job runs in ghcr.io/sarbian/ksp-ci (pinned by digest), which has
Mono and the .NET SDK 10.0, instead of installing Mono from the mono-project
repository on every run. That repository only had focal packages, which kept
the job pinned to ubuntu-24.04.

With SDK-style projects, the build is dotnet restore and dotnet msbuild, as in
MechJeb2: the only download left is KSPLibs.
@sarbian sarbian changed the title Build in the ksp-ci container, with the .NET SDK's MSBuild Build in the ksp-ci container, with SDK-style projects Nov 29, 2026
@sarbian
sarbian merged commit 61fb973 into master Nov 29, 2026
2 checks passed
@sarbian
sarbian deleted the ci/ksp-ci-image branch November 29, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant