Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
4a1a897
Rename properties to avoid namespace collisions, add more toggles
drewcassidy Jul 13, 2025
5fa2acd
fix syntax error
drewcassidy Jul 13, 2025
08ad322
Fix logic error double-importing system assemblies
drewcassidy Jul 14, 2025
31852ae
move references back where they belong, fix whitespace
drewcassidy Jul 14, 2025
b7d6a48
Fix tests
drewcassidy Jul 14, 2025
e2b205e
fix project path/name variables
drewcassidy Jul 14, 2025
cdc5ef6
fix test mod roots
drewcassidy Jul 14, 2025
ce6db03
oops
drewcassidy Jul 14, 2025
1c41d5f
Rename properties to begin with KSPBT
drewcassidy Jul 14, 2025
769b65e
add ability to declare mod dependencies with ModReference items
drewcassidy Jul 15, 2025
0b68619
Update changelog to reflect recent changes
drewcassidy Jul 16, 2025
96c6a69
Move references back to the targets file
drewcassidy Jul 16, 2025
a2a8bd1
Fix some bugs with CKAN install and tests
drewcassidy Jul 16, 2025
bd0a6ec
try something
drewcassidy Jul 18, 2025
e5bceff
add an sln
drewcassidy Jul 19, 2025
c68f3f1
More property renames and additions
drewcassidy Jul 20, 2025
81a8f40
fix ckan run target
drewcassidy Jul 21, 2025
65e7e78
fix ckan compatibility list in command
drewcassidy Jul 21, 2025
0898ecf
oops
drewcassidy Jul 21, 2025
b29fd6c
oops 2
drewcassidy Jul 21, 2025
159ae13
try something
drewcassidy Jul 21, 2025
9935d48
Try another thing
drewcassidy Jul 21, 2025
899869e
WHY
drewcassidy Jul 21, 2025
13c6577
OH NO
drewcassidy Jul 21, 2025
d809f3d
starting to understand this...
drewcassidy Jul 21, 2025
ede1af6
?
drewcassidy Jul 21, 2025
3d9007e
can I do this now?
drewcassidy Jul 21, 2025
1a2a80b
this might be cleaner?
drewcassidy Jul 21, 2025
0b82269
Try it out on more dotnet versions
drewcassidy Jul 21, 2025
cf333d2
move the last of the GameRoot logic to targets
drewcassidy Jul 22, 2025
a58bf43
Fix target dependency chain
drewcassidy Jul 22, 2025
72e8819
Move tests to ModReferences
drewcassidy Jul 22, 2025
105cc15
Make the stdlib avoidance thing conditional
drewcassidy Jul 24, 2025
b08da4a
Add default settings for the `Unity` configuration
drewcassidy Jul 24, 2025
cc7b850
Write more docs
drewcassidy Jul 24, 2025
7ec5f4d
Allow per-dependency disabling of attribute generation
drewcassidy Aug 6, 2025
d7421b7
Release 0.1.0-alpha.1
drewcassidy Aug 6, 2025
4147bc3
try this, see if it breaks anything
drewcassidy Oct 28, 2025
25a61cb
Fix verbosity setting
drewcassidy Oct 28, 2025
60b8167
Fix assetbundle test
drewcassidy Oct 28, 2025
a81f670
use dotnet nuget add source
drewcassidy Oct 28, 2025
2778355
try dotnet nuget restore
drewcassidy Oct 28, 2025
5d58022
Remove support for legacy csproj files
drewcassidy Oct 28, 2025
ed156a3
fix CI job
drewcassidy Oct 28, 2025
69d9e3b
Bump all jobs to ubuntu 24
drewcassidy Oct 28, 2025
774d077
Merge branch 'msbuild-refactor' into next
drewcassidy Oct 28, 2025
5410ef1
Fix wonky merge
drewcassidy Oct 28, 2025
364a50e
Update docs dependencies
drewcassidy Oct 28, 2025
7cd9ed8
Merge branch 'main' into next
drewcassidy Oct 28, 2025
e4dc1f7
Only include Log.cs when `KSPBT_ReferenceUnityAssemblies` is `true` (…
drewcassidy Oct 28, 2025
0687107
Fix #64
drewcassidy Oct 28, 2025
c109fec
Speed up setup-ckan action
drewcassidy Oct 28, 2025
dc6a280
need sudo
drewcassidy Oct 28, 2025
d17f961
fix option name
drewcassidy Oct 28, 2025
09427ed
Pin KSPBT actions within reusable workflows
drewcassidy Oct 29, 2025
14edc67
Re-enable support for packages.config style projects in `next` (#68)
drewcassidy Oct 29, 2025
f2e1cac
Fix typo in docs
drewcassidy Oct 30, 2025
af5d036
Move setup-dotnet out of compile action
drewcassidy Oct 30, 2025
6e879b7
Fix KSPBT not installing CKAN dependencies automatically
drewcassidy Oct 30, 2025
90899f6
Make KSPBT_ManagedRelativePath private
drewcassidy Oct 31, 2025
fd3c5f0
Add checks for SolutionDir not being empty in remaining uses
drewcassidy Oct 31, 2025
3a9f57b
assemble-release action: include .zip extension in output path
drewcassidy Oct 31, 2025
c6875d6
Update changelog
drewcassidy Oct 31, 2025
9f3fb56
Release 1.0.0-alpha.1
drewcassidy Oct 31, 2025
3eff5ce
Warn instead of error when running CKAN as root
drewcassidy Nov 6, 2025
4348377
re-include logging files in nuget package and add test
drewcassidy Nov 7, 2025
2fa2a86
Release 1.0.0-alpha.2
drewcassidy Nov 7, 2025
abe7037
Merge branch 'main' into next
drewcassidy Nov 7, 2025
28547cd
Add option for how to install CKAN
drewcassidy Nov 11, 2025
27d56b3
Change docs theme
drewcassidy Nov 14, 2025
f499ed2
Release 1.0.0-alpha.3
drewcassidy Nov 14, 2025
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
4 changes: 2 additions & 2 deletions .github/actions/assemble-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inputs:
default: "**/*.pdb"

output-file-name:
description: Output artifact name used in the upload-artifact action. a zip file with this name will be created in the github workspace so that it can be immediately consumed by other actions in the workflow without having to download the artifact.
description: Output artifact name used in the upload-artifact action WITHOUT ".zip" extension. a zip file with this name will be created in the github workspace so that it can be immediately consumed by other actions in the workflow without having to download the artifact.
default: ${{ github.event.repository.name || 'release'}}

working-directory:
Expand Down Expand Up @@ -61,7 +61,7 @@ runs:
run: |
zip -r ${{ github.workspace }}/${{ inputs.output-file-name }}.zip .
echo 'ARTIFACT_FILENAME=${{ inputs.output-file-name }}' >> $GITHUB_ENV
echo 'artifact-path=${{ github.workspace }}/${{ inputs.output-file-name }}' >> $GITHUB_OUTPUT
echo 'artifact-path=${{ github.workspace }}/${{ inputs.output-file-name }}.zip' >> $GITHUB_OUTPUT

- name: Upload Artifact
id: upload-artifact
Expand Down
30 changes: 17 additions & 13 deletions .github/actions/compile/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ inputs:
default: Release
description: The project configuration to build.

dotnet-version:
default: 5.x
description: Version of dotnet compiler to use. Defaults to 5.x.

ksp-zip-url:
default: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip
description: >
Expand All @@ -36,6 +32,12 @@ inputs:
default: ${{ github.workspace }}
description: the working directory to run in

use-nuget-restore:
default: 'false'
description: >
Set to true if your project uses a packages.config file instead of packagereferences. Ensure the environment has
nuget and mono installed, either installing them manually or by using the Github Ubuntu-22.04 images

runs:
using: composite
steps:
Expand All @@ -55,11 +57,6 @@ runs:
shell: bash
run: echo 'KSP_ROOT=${{ '/tmp/ksp' }}' >> "$GITHUB_ENV"

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.dotnet-version }}

- name: Download KSP Libs
shell: bash
run: |
Expand All @@ -68,13 +65,20 @@ runs:

- name: Restore Mod Solution
shell: bash
if: ${{ inputs.use-nuget-restore != 'true'}} # https://github.com/actions/runner/issues/1483 :sufferbeale:
working-directory: ${{ inputs.working-directory }}
run: dotnet restore ${{ inputs.solution-file-path }} ${{ runner.debug && '-v:diagnostic' }}

- name: Restore Mod Solution (NuGet)
shell: bash
if: ${{ inputs.use-nuget-restore == 'true'}}
working-directory: ${{ inputs.working-directory }}
run: nuget restore ${{ inputs.solution-file-path }} -Verbosity detailed

- name: Build Mod Solution
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
dotnet msbuild -m:1 -p:Configuration=${{ inputs.build-configuration }} \
-p:ManagedRelativePath=KSP_x64_Data/Managed ${{ inputs.solution-file-path }} \
${{ runner.debug && '-v:detailed' }}
run: >
dotnet msbuild -m:1 -p:Configuration=${{ inputs.build-configuration }}
-p:KSPBT_ManagedPath=${{ env.KSP_ROOT }}/KSP_x64_Data/Managed ${{ inputs.solution-file-path }}
${{ runner.debug && '-v:diagnostic' }}
16 changes: 11 additions & 5 deletions .github/actions/setup-ckan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ x-env:
description: The path to use as the root of a KSP instance for CKAN to set-up. If not set, `/tmp/ksp` is used instead.

inputs:
ckan-install-method:
description: Method of installing CKAN. Can be set to 'apt' to install from the official .deb file, or 'skip' to skip installation if your runner already has CKAN installed.
default: 'apt'

ckan-version:
description: CKAN tag to install. set to an empty string to always install the most recent version. See [the CKAN releases page](https://github.com/KSP-CKAN/CKAN/tags) for a list of available tags
default: ''
Expand Down Expand Up @@ -42,24 +46,26 @@ runs:
shell: bash
run: echo 'KSP_ROOT=${{ '/tmp/ksp' }}' >> "$GITHUB_ENV"

- name: Install CKAN
- name: Install CKAN via apt
if: ${{ inputs.ckan-install-method == 'apt' }}
shell: bash
run: |
sudo rm -f /var/lib/man-db/auto-update # skip updating man pages, which takes a long time and makes no sense in a CI job
gh release download ${{ inputs.ckan-version }} --repo ${{ inputs.ckan-repo }} --pattern 'ckan*.deb' -O ckan.deb
${{ env.ACT && 'sudo apt update --quiet' }}
sudo apt install --quiet ./ckan.deb ${{ runner.debug && '--verbose-versions' }}
sudo apt install --quiet --no-install-recommends --no-install-suggests ./ckan.deb ${{ runner.debug && '--verbose-versions' }}
ckan version
env:
GH_TOKEN: ${{ github.token }}

- name: Setup CKAN Instance
- name: Setup fake KSP instance
shell: bash
run: |
${{ runner.debug && 'echo "$PATH"' }}
ckan instance fake --set-default KSP ${{ env.KSP_ROOT }} 1.12.5 --game KSP --MakingHistory 1.9.1 --BreakingGround 1.7.1 ${{ runner.debug && '--verbose' }}
ckan update

- name: Setup CKAN Compatible Versions
- name: Setup CKAN compatible versions
shell: bash
if: inputs.ckan-compatible-versions != ''
run: |
Expand All @@ -69,7 +75,7 @@ runs:
env:
VERSIONS: ${{ inputs.ckan-compatible-versions }}

- name: Setup CKAN Filter
- name: Setup CKAN filter
shell: bash
if: inputs.ckan-filters != ''
run: |
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ on:
description: >
If MSBuild should be used. If your mod has no msbuild project (e.g. a pure part mod)
you should set this to false
use-nuget-restore:
type: boolean
default: false
description: >
Set to true if your project uses a packages.config file instead of packagereferences. This will cause the job
to run on the Ubuntu-22.04 image instead of Ubuntu-24.04
dotnet-version:
type: string
default: 8.x
description: Version of dotnet compiler to use.
use-ckan:
type: boolean
default: false
Expand All @@ -37,34 +47,40 @@ defaults:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ${{ inputs.use-nuget-restore && 'ubuntu-22.04' || 'ubuntu-24.04' }}
steps:
- name: Checkout Mod Repo
uses: actions/checkout@v4
with:
submodules: true

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.dotnet-version }}

# Install CKAN and set up an instance
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected].5
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/setup-ckan@1.0.0-alpha.3
if: ${{ (inputs.use-ckan && inputs.use-msbuild) || inputs.dependency-identifiers }}

# Install any listed CKAN dependencies
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected].5
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@1.0.0-alpha.3
if: ${{ inputs.dependency-identifiers }}
with:
dependency-identifiers: ${{ inputs.dependency-identifiers }}

# Compile the mod
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected].5
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@1.0.0-alpha.3
if: ${{ inputs.use-msbuild }}
with:
build-configuration: ${{ inputs.build-configuration }}
ksp-zip-url: ${{ inputs.ksp-zip-url }}
ksp-zip-password: ${{ secrets.ksp-zip-password }}
solution-file-path: ${{ inputs.solution-file-path }}
use-nuget-restore: ${{ inputs.use-nuget-restore }}

# Assemble the mod into a release package and upload it as an artifact
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected].5
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@1.0.0-alpha.3
with:
artifacts: ${{ inputs.artifacts }}
output-file-name: ${{ github.event.repository.name }}-${{ inputs.build-configuration }}
10 changes: 5 additions & 5 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
submodules: true

- name: update-version
uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected].5
uses: KSPModdingLibs/KSPBuildTools/.github/actions/update-version@1.0.0-alpha.3
with:
version-string: ${{ inputs.version-string }}
template-extension: ${{ inputs.version-template-extension }}
Expand All @@ -81,18 +81,18 @@ jobs:
git tag -f -a "$VERSION_STRING" -m "$VERSION_STRING"

# Install CKAN and set up an instance
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected].5
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/setup-ckan@1.0.0-alpha.3
if: ${{ (inputs.use-ckan && inputs.use-msbuild) || inputs.dependency-identifiers }}

# Install any listed CKAN dependencies
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected].5
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@1.0.0-alpha.3
if: ${{ inputs.dependency-identifiers }}
with:
dependency-identifiers: ${{ inputs.dependency-identifiers }}

- name: compile
if: ${{ inputs.use-msbuild }}
uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected].5
uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@1.0.0-alpha.3
with:
build-configuration: ${{ inputs.build-configuration }}
ksp-zip-url: ${{ inputs.ksp-zip-url }}
Expand All @@ -101,7 +101,7 @@ jobs:

- name: assemble-release
id: assemble-release
uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected].5
uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@1.0.0-alpha.3
with:
artifacts: ${{ inputs.artifacts }}
output-file-name: ${{ github.event.repository.name }}-${{ env.VERSION_STRING }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/internal-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
outputs:
package-version: ${{ steps.get-version.outputs.version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/internal-test-assetbundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/internal-test-plugin-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'

- uses: ./.github/actions/setup-ckan

- uses: ./.github/actions/compile
with:
ksp-zip-url: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip
working-directory: ${{ env.TESTDIR }}
use-nuget-restore: true

- uses: ./.github/actions/assemble-release
with:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/internal-test-plugin-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,24 @@ env:
NuGetDirectory: ${{ github.workspace}}/nuget

jobs:

build:
runs-on: ubuntu-22.04
strategy:
matrix:
dotnet-version: [ 7.x, 8.x, 9.x ]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: ${{ matrix.dotnet-version }}

- name: Setup Nuget Package Sources
run: |
mkdir -p ${{ env.NuGetDirectory }}/local
nuget sources add -Name local -Source ${{ env.NuGetDirectory }}/local
dotnet nuget add source ${{ env.NuGetDirectory }}/local -n local

- uses: actions/download-artifact@v4
with:
Expand All @@ -39,11 +43,11 @@ jobs:
with:
ksp-zip-url: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip
working-directory: ${{ env.TESTDIR }}
solution-file-path: plugin-mod.csproj
solution-file-path: plugin-mod-nuget.csproj
env:
KSPBuildToolsVersion: ${{ inputs.package-version }}

- uses: ./.github/actions/assemble-release
with:
artifacts: ${{ env.TESTDIR }}/GameData
output-file-name: plugin-mod-nuget
output-file-name: plugin-mod-nuget-${{ matrix.dotnet-version }}
7 changes: 6 additions & 1 deletion .github/workflows/internal-test-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ env:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'

- uses: ./.github/actions/setup-ckan

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-spacedock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ on:

jobs:
publish-to-spacedock:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: get-release-info
id: get-release-info
uses: KSPModdingLibs/KSPBuildTools/.github/actions/[email protected].5
uses: KSPModdingLibs/KSPBuildTools/.github/actions/get-release-info@1.0.0-alpha.3
with:
release-tag: ${{ inputs.release-tag }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
validate:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
bin
obj
*.nupkg
packages

# docs
docs/_build
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

All notable changes to this project will be documented in this file

## 1.0.0-alpha.3 - 2025-11-14

### Msbuild

- Renamed global msbuild properties to have the `KSPBT_` prefix to avoid namespace collisions with other frameworks
- `KSPRoot` is now `KSPBT_GameRoot`. It should no longer be referenced within a .csproj file
- `RepoRootPath` is now `KSPBT_ModRoot`, and should now point to the mod folder within GameData rather than the
root of a git repo
- `BinariesOutputRelativePath` is now `KSPBT_ModPluginFolder`
- `GenerateKSPAssemblyAttribute` is now `KSPBT_GenerateAssemblyAttribute` and defaults to true
- `GenerateKSPAssemblyDependencyAttributes` is now `KSPBT_GenerateDependencyAttributes` and defaults to true
- `ReferenceUnityAssemblies` is now `KSPBT_ReferenceUnityAssemblies`
- `ReferenceKSPAssemblies` is now `KSPBT_ReferenceGameAssemblies`
- Added the `KSPBT_ReferenceSystemAssemblies` property to control referencing the mono system DLLs within the KSP
managed folder. Setting this property to false will load the implicit framework DLLs instead.
- Mod dependencies should now be declared with
`ModReference` items. This avoids the need for the KSP install path to be known at evaluation time.
- Only include Log.cs (or anything else in include/unity) when `KSPBT_ReferenceUnityAssemblies` is `true` (#61)
- Fix `KSP_VERSION_MAX` getting mangled when using an existing version file (#64)
- Fix incorrect behavior when building without a solution (#50)

### Actions

- KSPBT actions used in reusable workflows are now pinned with each tag, instead of using actions from `main`. All calls to reusable workflows should be pinned to a tag to ensure the correct actions are being used. (#21)
- `compile` action: Use `dotnet restore` instead of `nuget restore` by default, allowing the action to work on any Ubuntu runner image. Added the `use-nuget-restore` option to restore the previous behavior for projects that use packages.config for dependencies. (#68)
- `compile` action: Removed call to`actions/setup-dotnet`. Setting up .NET should be done as a separate step. (#65)
- `setup-ckan` action: Sped up execution by skipping recommended packages and man-db updates
- `setup-ckan` action: Add `ckan-install-method` option for installation method. Currently supports `'apt'` for installation on Debian/Ubuntu, or `'skip'` to skip installation for runners that already have CKAN installed.
- `assemble-release` action: `outputs.artifact-path` now includes the `.zip` extension (#51)


## 0.0.5 - 2025-11-07

Several non-breaking bugfixes backported from the next development version
Expand Down
Loading