Repository navigation
96 lines (87 loc) · 3.22 KB
/
Copy pathbuild.yml
File metadata and controls
96 lines (87 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: build
on:
workflow_call:
inputs:
build-configuration:
type: string
default: Release
artifacts:
type: string
default: GameData LICENSE* README* CHANGELOG*
ksp-zip-url:
type: string
default: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip
dependency-identifiers:
type: string
solution-file-path:
type: string
use-msbuild:
type: boolean
default: true
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
description: >
If CKAN should be installed to install dependencies in the msbuild project.
secrets:
ksp-zip-password:
required: false
defaults:
run:
shell: bash
jobs:
build:
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/setup-ckan@1.1.1
if: ${{ (inputs.use-ckan && inputs.use-msbuild) || inputs.dependency-identifiers }}
# Install any listed CKAN dependencies
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@1.1.1
if: ${{ inputs.dependency-identifiers }}
with:
dependency-identifiers: ${{ inputs.dependency-identifiers }}
# Compile the mod
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@1.1.1
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
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@1.1.1
id: assemble-release
with:
artifacts: ${{ inputs.artifacts }}
output-file-name: ${{ github.event.repository.name }}
# Upload artifact
- uses: actions/upload-artifact@v4
id: upload-artifact
with:
path: ${{ steps.assemble-release.outputs.artifact-dir-path }}
name: ${{ github.event.repository.name }}-${{ inputs.build-configuration }}
if-no-files-found: error
include-hidden-files: 'true' # behavior changed in 4.4.0. Include hidden for matching the behavior of `zip`