Skip to content

Commit 7e67b51

Browse files
committed
pass version string from create-release into msbuild arge
-use this as the version property if available
1 parent 8da2de0 commit 7e67b51

4 files changed

Lines changed: 20 additions & 1 deletion

File tree

.github/actions/compile/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ inputs:
3838
Set to true if your project uses a packages.config file instead of packagereferences. Ensure the environment has
3939
nuget and mono installed, either installing them manually or by using the Github Ubuntu-22.04 images
4040
41+
msbuild-args:
42+
description: >
43+
Additional args to pass to msbuild
44+
4145
runs:
4246
using: composite
4347
steps:
@@ -80,5 +84,5 @@ runs:
8084
working-directory: ${{ inputs.working-directory }}
8185
run: >
8286
dotnet msbuild -m:1 -p:Configuration=${{ inputs.build-configuration }}
83-
-p:KSPBT_ManagedPath=${{ env.KSP_ROOT }}/KSP_x64_Data/Managed ${{ inputs.solution-file-path }}
87+
-p:KSPBT_ManagedPath=${{ env.KSP_ROOT }}/KSP_x64_Data/Managed ${{ inputs.msbuild-args }} ${{ inputs.solution-file-path }}
8488
${{ runner.debug && '-v:diagnostic' }}

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ on:
2222
description: >
2323
If MSBuild should be used. If your mod has no msbuild project (e.g. a pure part mod)
2424
you should set this to false
25+
msbuild-args:
26+
type: string
27+
description: >
28+
Any additional args to pass to msbuild
2529
use-nuget-restore:
2630
type: boolean
2731
default: false
@@ -78,6 +82,7 @@ jobs:
7882
ksp-zip-password: ${{ secrets.ksp-zip-password }}
7983
solution-file-path: ${{ inputs.solution-file-path }}
8084
use-nuget-restore: ${{ inputs.use-nuget-restore }}
85+
msbuild-args: ${{ inputs.msbuild-args }}
8186

8287
# Assemble the mod into a release package
8388
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@1.1.1

.github/workflows/create-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ on:
3131
description: >
3232
If MSBuild should be used. If your mod has no msbuild project (e.g. a pure part mod)
3333
you should set this to false
34+
msbuild-args:
35+
type: string
36+
description: >
37+
Any additional args to pass to msbuild
3438
use-ckan:
3539
type: boolean
3640
default: false
@@ -98,6 +102,7 @@ jobs:
98102
ksp-zip-url: ${{ inputs.ksp-zip-url }}
99103
ksp-zip-password: ${{ secrets.ksp-zip-password }}
100104
solution-file-path: ${{ inputs.solution-file-path }}
105+
msbuild-args: ${{ inputs.msbuild-args }} -p:KSPBT_ModVersion=${{ inputs.version-string }}
101106

102107
- name: assemble-release
103108
id: assemble-release

KSPCommon.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@
6767
</KSPVersionFile>
6868
</ItemDefinitionGroup>
6969

70+
<!-- version provided by create-release workflow, if available -->
71+
<PropertyGroup Condition=" '$(KSPBT_ModVersion)' != '' ">
72+
<Version>$(KSBT_ModVersion)</Version>
73+
</PropertyGroup>
74+
7075
<!--Parse KSP platform-specific paths -->
7176
<PropertyGroup Condition=" '$(_KSPBT_ManagedRelativePath)' == '' ">
7277
<_KSPBT_ManagedRelativePath Condition=" $([MSBuild]::IsOsPlatform('Windows')) ">KSP_x64_Data/Managed</_KSPBT_ManagedRelativePath>

0 commit comments

Comments
 (0)