Skip to content

Commit 2591afb

Browse files
committed
Add option to use nuget to restore, but requires it be installed
This reverts commit ed156a3.
1 parent fb4e220 commit 2591afb

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.github/actions/compile/action.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ inputs:
3636
default: ${{ github.workspace }}
3737
description: the working directory to run in
3838

39+
use-nuget:
40+
default: false
41+
description: >
42+
Set to true if your project uses a packages.config file instead of packagereferences. Ensure the environment has
43+
nuget and mono installed, either installing them manually or by using the Github Ubuntu-22.04 images
44+
3945
runs:
4046
using: composite
4147
steps:
@@ -68,8 +74,15 @@ runs:
6874
6975
- name: Restore Mod Solution
7076
shell: bash
77+
if: inputs.use-nuget == false
78+
working-directory: ${{ inputs.working-directory }}
79+
run: dotnet restore ${{ inputs.solution-file-path }} ${{ runner.debug && '-v:diagnostic' }}
80+
81+
- name: Restore Mod Solution (NuGet)
82+
shell: bash
83+
if: inputs.use-nuget == true
7184
working-directory: ${{ inputs.working-directory }}
72-
run: dotnet nuget restore ${{ inputs.solution-file-path }} ${{ runner.debug && '-v:diagnostic' }}
85+
run: nuget restore ${{ inputs.solution-file-path }} -Verbosity detailed
7386

7487
- name: Build Mod Solution
7588
shell: bash

.github/workflows/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ 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+
use-nuget:
26+
type: boolean
27+
default: false
28+
description: >
29+
Set to true if your project uses a packages.config file instead of packagereferences. This will cause the job
30+
to run on the Ubuntu-22.04 image instead of Ubuntu-24.04
2531
use-ckan:
2632
type: boolean
2733
default: false
@@ -37,7 +43,7 @@ defaults:
3743

3844
jobs:
3945
build:
40-
runs-on: ubuntu-22.04
46+
runs-on: ${{ inputs.use-nuget == true && 'ubuntu-22.04' || 'ubuntu-24.04' }}
4147
steps:
4248
- name: Checkout Mod Repo
4349
uses: actions/checkout@v4
@@ -62,6 +68,7 @@ jobs:
6268
ksp-zip-url: ${{ inputs.ksp-zip-url }}
6369
ksp-zip-password: ${{ secrets.ksp-zip-password }}
6470
solution-file-path: ${{ inputs.solution-file-path }}
71+
use-nuget: ${{ inputs.use-nuget }}
6572

6673
# Assemble the mod into a release package and upload it as an artifact
6774
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@main

.github/workflows/internal-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070

7171
deploy:
7272
runs-on: ubuntu-22.04
73-
needs: [ build, test-plugin, test-plugin-nuget, test-assetbundle ]
73+
needs: [ build, test-plugin, test-plugin-nuget, test-plugin-legacy, test-assetbundle ]
7474
environment:
7575
name: "NuGet"
7676
url: "https://www.nuget.org/packages/KSPBuildTools"

0 commit comments

Comments
 (0)